Pytorch implementation of "M-LSD: Towards Light-weight and Real-time Line Segment Detection"

Overview

M-LSD: Towards Light-weight and Real-time Line Segment Detection

Pytorch implementation of "M-LSD: Towards Light-weight and Real-time Line Segment Detection"

origin repo: https://github.com/navervision/mlsd

Overview

First figure: Comparison of M-LSD and existing LSD methods on GPU. Second figure: Inference speed and memory usage on mobile devices.

demo

How to run demo

Install requirements

pip install -r requirements.txt

Run demo

python demo_MLSD_flask.py
python demo.py

Citation

If you find M-LSD useful in your project, please consider to cite the following paper.

@misc{gu2021realtime,
    title={Towards Real-time and Light-weight Line Segment Detection},
    author={Geonmo Gu and Byungsoo Ko and SeoungHyun Go and Sung-Hyun Lee and Jingeun Lee and Minchul Shin},
    year={2021},
    eprint={2106.00186},
    archivePrefix={arXiv},
    primaryClass={cs.CV}
}

License

Copyright 2021-present NAVER Corp.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • performance speed

    performance speed

    Thanks for your great repository !!!

    I ran demo.py, and measured large model performance speed, it resulted in almost 12FPS on RTX 2080Ti. Codes likes below:

    import time
    torch.cuda.synchronize()
    start=time.time()
    img = cv2.imread(img_fn)
    img = cv2.resize(img, (512, 512))
    
    img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
    lines = pred_lines(img, model, [512, 512], 0.1, 20)
    img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
    
    for l in lines:
        cv2.line(img, (int(l[0]), int(l[1])), (int(l[2]), int(l[3])), (0,200,200), 1,16)
        
    torch.cuda.synchronize()
    time.time()-start
    # 0.0828
    

    So, in your environment, how fast does large model work ?? (and I'd like to know your GPU envirnoment ).

    opened by hirokic5 3
  • TensorRT Edition

    TensorRT Edition

    • Added TensorRT/ Jetson support with a command line script.
    • FP16 and int8 calibration support.
    • Prerequisites, and usage has been addded to the readme.
    • Tested and benchmarked on both a Xavier NX , and an AGX Xavier (benches have been added to the README).
    • Added a floor divide update for the latest version of torch.
    opened by rhysdg 2
  • Compatibility with new RTX 3080 cards

    Compatibility with new RTX 3080 cards

    In case others have similar issues.

    On Ubuntu 20.04 with driver 460 and Cuda 11.2, current docker compose did not work.

    Until I added Gpu capability in docker-compose.yaml, pytorch did not see video card and complained about missing nvidia driver: RuntimeError: Found no NVIDIA driver on your system.

    Next, after docker-compose.yaml fix, default version of torch, gave me this error: GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation.

    These are changes I made to fix errors above:

    diff --git a/Dockerfile b/Dockerfile
    index dc3d37a..d4b53b1 100644
    --- a/Dockerfile
    +++ b/Dockerfile
    @@ -12,5 +12,6 @@ RUN apt-get update \
         python3 \
         python3-pip \
       && python -m pip install --no-cache-dir -r requirements.txt \
    +  && python -m pip install --no-cache-dir torch==1.7.0+cu110 -f https://download.pytorch.org/whl/torch_stable.html \
       && rm -f requirements.txt \
       && rm -rf /var/lib/apt/lists/*
    diff --git a/docker-compose.yml b/docker-compose.yml
    index a112550..ba7ce58 100644
    --- a/docker-compose.yml
    +++ b/docker-compose.yml
    @@ -13,3 +13,8 @@ services:
           - ${PWD}:/ws
         working_dir: /ws
         command: "python demo.py"
    +    deploy:
    +      resources:
    +        reservations:
    +          devices:
    +          - capabilities: [gpu]
    \ No newline at end of file
    diff --git a/requirements.txt b/requirements.txt
    index ba4a747..05f1227 100644
    --- a/requirements.txt
    +++ b/requirements.txt
    @@ -1,6 +1,6 @@
     numpy
     opencv-python
     pillow
    -torch
    +# torch
     Flask
     requests
    

    You need to use docker-compose version 1.27 or newer.

    opened by dsvua 1
  • Run demos in docker

    Run demos in docker

    This PR allows to run the provided demos in a docker environment based on ubuntu 20.04 and cuda 11.1.1. As the code is directly mounted in the container, modifications can be made without having to rebuild the image.

    opened by f-fl0 1
  • fix image color

    fix image color

    Hi. Thank you for the Pytorch version of the code. I tried running demo.py, but the color of the result image was strange. I tried to fix it, so please check it if you like.

    | before | after | | ---- | ---- | | frame_1_out_before | frame_1_out_after |

    opened by kobot30 1
  • No such file or directory: '/models/mlsd_large_512_fp32.pth'

    No such file or directory: '/models/mlsd_large_512_fp32.pth'

    After trying to execute !python demo.py, I get an error:

    Traceback (most recent call last): File "demo.py", line 37, in main() File "demo.py", line 23, in main model.load_state_dict(torch.load(model_path, map_location=device), strict=True) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 594, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/models/mlsd_large_512_fp32.pth `

    The file mlsd_large_512_fp32.pth is in the same directory as well as the models folder

    opened by shukkkur 1
  • fatal error

    fatal error

    When I reached the second round of training, I found that the imported labels in the getitem (self, index) had negative numbers, and the imported labels were not the same as the actual ones, but this did not happen when I did not use the self._geo_aug or did not use partial enhancements.

    opened by zhuxn98 0
  • Project dependencies may have API risk issues

    Project dependencies may have API risk issues

    Hi, In mlsd_pytorch, inappropriate dependency versioning constraints can cause risks.

    Below are the dependencies and version constraints that the project is using

    numpy
    opencv-python
    pillow
    torch
    Flask
    requests
    

    The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

    After further analysis, in this project, The version constraint of dependency numpy can be changed to >=1.8.0,<=1.23.0rc3. The version constraint of dependency pillow can be changed to ==9.2.0. The version constraint of dependency pillow can be changed to >=2.0.0,<=9.1.1. The version constraint of dependency requests can be changed to >=0.2.1,<=0.2.3. The version constraint of dependency requests can be changed to >=0.7.0,<=2.24.0. The version constraint of dependency requests can be changed to ==2.26.0.

    The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

    The invocation of the current project includes all the following methods.

    The calling methods from the numpy
    numpy.linalg.norm
    
    The calling methods from the pillow
    PIL.Image.open
    
    The calling methods from the requests
    requests.get
    
    The calling methods from the all methods
    self.infos.setdefault.append
    calibrator.ImageFolderCalibDataset
    os.path.basename
    self._load_pretrained_model
    mlsd_pytorch.utils.decode.deccode_lines_TP
    self.load_label
    mlsd_pytorch.data.utils.cut_line_by_xmin
    model
    len_and_angle_loss_func
    io.BytesIO
    self.modules
    segment_list.np.array.reshape
    numpy.float32.precisions.np.array.mean
    pred_lines.detach.cpu.numpy.detach
    yx.detach.cpu.numpy.detach
    heat.cpu.numpy.reshape
    self.infos.setdefault
    self.matching_loss_func
    self.block21
    flask.json.dump
    msgs.append
    build_argparser.parse_args
    build_argparser
    batch_data.cuda
    index.self.anns.copy
    numpy.stack.reshape
    image.copy.copy
    weighted_bce_with_logits
    self.block13
    torch.nn.init.zeros_
    yacs.config.CfgNode.clone
    im.transpose
    time.time
    torch.utils.model_zoo.load_url
    self.Line_Dataset.super.__init__
    self.line_and_juc_seg_loss
    max_acc_map.acc_map.float
    xx.yy.displacement.reshape
    models.mbv2_mlsd_tiny.MobileV2_MLSD_Tiny.cuda
    numpy.load
    xx.yy.displacement.reshape.permute
    self.block12
    torch.floor_divide
    self._m_match_loss_fn
    self.model.state_dict
    logger.info
    mlsd_pytorch.models.mbv2_mlsd_large.MobileV2_MLSD_Large
    torch.nn.functional.max_pool2d.numpy
    numpy.expand_dims
    self.val
    self._geo_aug
    numpy.argmin
    torch.nn.init.constant
    gt.lt
    acc_map_np.torch.from_numpy.unsqueeze.unsqueeze
    gen_TP_mask2
    flask.send_from_directory
    torch.onnx.export
    numpy.argmax
    PIL.Image.open
    flask.Flask
    torch.cuda.manual_seed
    __mapping_dataset.keys
    torch.nn.functional.binary_cross_entropy_with_logits
    torch.nn.init.normal_
    mlsd_pytorch.data.utils.swap_line_pt_maybe
    displacement_loss_func
    mlsd_pytorch.models.mbv2_mlsd.MobileV2_MLSD
    numpy.fliplr
    albumentations.OneOf
    pos_pred.nelement
    xmax_lines.append
    mlsd_pytorch.data.utils.TP_map_to_line_numpy
    numpy.max
    exit
    lines_gt.lines_dt.sum
    near_area_n
    self.sol_mask_loss
    square_list.append
    bisect.bisect_right
    loss_dict.update
    numpy.array
    models.mbv2_mlsd_large.MobileV2_MLSD_Large.cuda
    self.scheduler.get_lr
    heat.cpu.numpy.cpu
    img.torch.from_numpy.unsqueeze.float.cuda
    self._line_len_fn
    requests.get
    numpy.unique
    thop.profile
    max_acc_map.acc_map.float.reshape
    torch.abs
    torch.randn.float.to
    self.backbone
    self.model.train
    Line_Dataset
    torch.nn.functional.pairwise_distance
    torch.optim.Adam
    torch.nn.init.kaiming_normal_
    train
    self.MobileV2_MLSD_Tiny.super.__init__
    torch.load
    dis_list.transpose.transpose
    heat.hmax.float
    anns.append
    junction_map.min.min
    mlsd_pytorch.cfg.default.get_cfg_defaults.merge_from_file
    line_len_and_angle
    f.close
    lines_gt.reshape.reshape
    enumerate
    torch2trt.torch2trt.load_state_dict
    gt_dis.pred_dis.F.smooth_l1_loss.sum.min
    lines_dt.reshape.reshape
    inter_y.inter_x.np.concatenate.astype
    self.load
    norm_lines_512_list.append
    model_graph.decode_image
    numpy.min
    pred.unsqueeze
    utils.pred_lines
    args.config.strip
    random.seed
    scores.detach.cpu.numpy.detach
    argparse.ArgumentParser
    models.mbv2_mlsd_large.MobileV2_MLSD_Large
    r_lines.append
    numpy.concatenate.append
    torch.cat
    torch.nn.MaxPool2d
    numpy.arccos
    numpy.transpose
    self.block23
    tensorflow.lite.Interpreter.allocate_tensors
    cfg.build_model.cuda.eval
    numpy.random.seed
    angle_loss.sum.sum
    cv2.line
    img.torch.from_numpy.unsqueeze
    model_graph.save_output
    self.MobileV2_MLSD.super.__init__
    torch.nn.Sequential
    numpy.minimum
    self.infos.iteritems
    torch.nn.init.ones_
    os.path.join
    infer_one
    train_loss.item
    self.bilinear_kernel
    img_origin_list.append
    batch_image.torch.from_numpy.float.cuda
    mlsd_pytorch.data.utils.gen_SOL_map
    cfg.build_model.cuda.eval.load_state_dict
    neg_mask.loss.sum
    gt.eq.float
    resized_image.transpose.transpose
    fpn_features.append
    mlsd_pytorch.learner.Simple_MLSD_Learner
    torch.zeros_like
    join
    self.block16
    torch.ones
    numpy.float
    mlsd_pytorch.data.utils.cut_line_by_xmax
    format
    module
    self.scheduler.step
    indices.hough.astype
    near_area_n.extend
    cfg.datasets.name.__mapping_dataset
    build_argparser.parse_args.add_argument
    deccode_output_score_and_ptss
    self.LineSegmentLoss.super.__init__
    gt_dis.pred_dis.F.smooth_l1_loss.sum
    self.logger.write
    numpy.linalg.norm
    numpy.sort
    ConvBNReLU
    BlockTypeA
    numpy.array.append
    self.loss_fn.item
    numpy.ones
    msTPFP
    tensorflow.lite.Interpreter.get_output_details
    img_fns.append
    ptss.detach.cpu.numpy
    pred_infos.append
    numpy.float32.f_scores.np.array.mean
    torch.argsort
    numpy.flipud
    heat.reshape.reshape
    max
    numpy.asarray
    tensorflow.lite.Interpreter.set_tensor
    yx.detach.cpu
    line_pred.reshape.reshape
    get_collate_fn
    torch.log
    torch2trt.torch2trt.state_dict
    norm_lines_512_all_tensor_list.append
    displacement.detach.cpu.numpy
    segment_list.append
    random.random
    torch.nn.BatchNorm2d
    numpy.array.detach
    yacs.config.CfgNode
    self.block14
    numpy.reshape
    self.WarmupMultiStepLR.super.__init__
    MobileV2_MLSD
    torch.arange
    cfg.build_model.cuda.load_state_dict
    self.BlockTypeC.super.__init__
    NotImplementedError
    f
    super.__init__
    tensorflow.lite.Interpreter
    self.model.parameters
    str
    pred_lines.detach.cpu.numpy
    numpy.sqrt
    pos_mask.unsqueeze.sum
    self.ConvBNReLU.super.__init__
    time.monotonic
    mlsd_pytorch.data.utils.gen_TP_mask2
    torch.randn
    models.mbv2_mlsd_tiny.MobileV2_MLSD_Tiny
    torch.device
    norm_lines.append
    line_gt.reshape.reshape
    float
    mlsd_pytorch.data.utils.get_ext_lines
    self.BlockTypeB.super.__init__
    mlsd_pytorch.cfg.default.get_cfg_defaults.dump
    cv2.resize
    main
    parse_label_file_info.append
    albumentations.Normalize
    loss_dict.items
    gt_dis.pred_dis2.F.smooth_l1_loss.sum
    get_ext_lines
    layers.append
    mlsd_pytorch.metric.F1_score_128
    pos_inds.float.sum
    MobileNetV2
    yx.detach.cpu.numpy
    ann_origin.copy.append
    numpy.roll
    torch.optim.lr_scheduler.LambdaLR
    mlsd_pytorch.learner.Simple_MLSD_Learner.train
    square.reshape
    cfg.build_model.cuda
    self.model.zero_grad
    self.MobileV2_MLSD_Large.super.__init__
    self.cache_dict.keys
    isinstance
    norm_lines_512_all.append
    line_gt.line_pred.sum
    torch.nn.ReLU6
    self.BlockTypeA.super.__init__
    x0.abs
    self.InvertedResidual.super.__init__
    self.state_dict
    mlsd_pytorch.data.utils.deccode_lines
    albumentations.RandomBrightnessContrast
    connect_list.append
    cv2.imdecode
    cv2.imwrite
    numpy.maximum
    torch.utils.model_zoo.load_url.items
    self.log_file.close
    numpy.where
    recalls.append
    block
    pred_lines_fn
    cv2.GaussianBlur
    sorted
    abs
    self.conv3
    pos_mask.loss.sum
    torch.div
    torch.fmod
    mlsd_pytorch.data.get_train_dataloader
    self.tp_mask_loss
    self.loss_w_dict.keys
    displacement.detach.cpu.numpy.detach
    torch.nn.functional.interpolate
    mlsd_pytorch.data.utils.gen_junction_and_line_mask
    self.model
    mlsd_pytorch.utils.comm.setup_seed
    torch.sigmoid
    torch.topk
    tensorflow.lite.Interpreter.get_input_details
    numpy.float32.recalls.np.array.mean
    layers.extend
    BlockTypeC
    numpy.abs
    displacement.transpose.detach
    y0.abs
    parse_label_file_info
    tensorflow.lite.Interpreter.invoke
    self.block18
    acc_map_np.torch.from_numpy.unsqueeze
    torch.sqrt.sum
    torch.sqrt
    list
    numpy.arctan
    self._m_gt_matched_n
    tqdm.tqdm
    torchvision.datasets.ImageFolder
    pos_loss.sum.sum
    x.torch.from_numpy.unsqueeze
    _C.clone.merge_from_other_cfg
    numpy.frombuffer
    near_area_n.detach
    torch.cuda.current_stream.synchronize
    flask.request.files.save
    _nms
    self.draw_output
    models.mbv2_mlsd_large.MobileV2_MLSD_Large.cuda.eval.load_state_dict
    __mapping_dataset_collate_fn.keys
    w.indices.torch.fmod.unsqueeze
    pos_mask.unsqueeze.unsqueeze
    milestones.append
    albumentations.HueSaturationValue
    self._load_anns
    torch.sum
    MobileV2_MLSD_Large
    torch.nn.ReLU
    torch.cuda.manual_seed_all
    torch.abs.view
    torch.cuda.is_available
    self.test_aug
    tqdm.tqdm.set_description
    mlsd_pytorch.utils.comm.create_dir
    gt_lines.cuda.cuda
    img.torch.from_numpy.unsqueeze.float
    cv2.circle
    len
    self.loss_w_dict.update
    os.mkdir
    segments_list.append
    corner_info.corner_dict.append
    ConvBNReLU.append
    self.step
    mlsd_pytorch.cfg.default.get_cfg_defaults
    torch2trt.torch2trt
    self.block22
    mlsd_pytorch.data.get_val_dataloader
    albumentations.Compose
    open
    mlsd_pytorch.metric.msTPFP
    os.makedirs
    heat.cpu.numpy
    self.block15
    self._crop_aug
    check_outside_inside
    cv2.cvtColor
    os.path.splitext
    BilinearConvTranspose2d
    self.log_file.write
    models.mbv2_mlsd_tiny.MobileV2_MLSD_Tiny.to
    torch.nn.functional.pad
    random.randint
    x.torch.from_numpy.unsqueeze.unsqueeze
    gt.eq
    self.loss_fn
    device.MobileV2_MLSD_Tiny.to.eval
    loss.backward
    square_list.np.array.reshape
    mlsd_pytorch.loss.LineSegmentLoss
    torch.cdist
    pred_lines_list.append
    near_area_n.append
    batch_image.torch.from_numpy.float
    outputs.unsqueeze.unsqueeze
    torch.nn.Conv2d
    mlsd_pytorch.optim.lr_scheduler.WarmupMultiStepLR
    torch.nn.utils.clip_grad_norm_
    model.engine.serialize
    mlsd_pytorch.metric.AP
    model_graph.read_image
    ptss.detach.cpu
    get_args
    torch.randn.float
    heat.torch.from_numpy.unsqueeze
    y1.abs
    onnx_convert
    xmax.img.copy
    AP
    args.config.endswith
    center_pos.transpose.transpose
    model.eval.eval
    segments_list.np.array.reshape
    resized_image.np.expand_dims.astype
    img.torch.from_numpy.unsqueeze.float.cuda.transpose
    square_length.append
    torch.pow
    gt_infos.append
    self.block20
    f.write
    flask.Flask.run
    cv2.polylines
    torch.utils.data.DataLoader
    w.indices.torch.floor_divide.unsqueeze
    self._forward_impl
    math.cos
    flask.render_template
    self._aug_train
    super
    len_loss.sum.sum
    w.indices.torch.div.unsqueeze
    json.load
    displacement_loss_func.sum
    mlsd_pytorch.utils.logger.TxtLogger
    response.content.BytesIO.Image.open.convert
    numpy.clip
    pred_lines.detach.cpu
    cfg.build_model.cuda.parameters
    argparse.ArgumentParser.add_argument_group
    gt_lines_128.tolist
    torch.manual_seed
    print
    self.load_state_dict
    junction_map.min.max
    models.mbv2_mlsd_tiny.MobileV2_MLSD_Tiny.cuda.eval.load_state_dict
    calculate_sAP
    self.conv
    torch.save
    pred_lines_128.tolist
    x1.abs
    self.train_aug
    f_scores.append
    pickle.dump
    numpy.arctan2
    pickle.load
    ann_origin.copy
    torch.nn.functional.l1_loss
    os.path.exists
    self.block17.reset_parameters
    xmin_lines.append
    range
    torch.no_grad
    io.BytesIO.getvalue
    test_aug
    numpy.argsort
    numpy.mean
    argparse.ArgumentParser.add_argument
    self.log_file.flush
    argparse.ArgumentParser.parse_args
    cv2.imread
    mlsd_pytorch.models.build_model.build_model
    ImportError
    model.read_image.copy
    neg_loss.sum.sum
    round
    numpy.concatenate
    models.mbv2_mlsd_tiny.MobileV2_MLSD_Tiny.cuda.eval
    displacement.transpose.transpose
    self.optimizer.step
    mlsd_pytorch.utils.meter.AverageMeter
    torch.ones_like
    uuid.uuid1
    centermap.min.min
    models.mbv2_mlsd_large.MobileV2_MLSD_Large.cuda.eval
    torch.cuda.current_stream
    torch.nn.functional.smooth_l1_loss
    model_graph.pred
    torch.nn.functional.max_pool2d
    junc_list.append
    utils.pred_squares
    self._aug_test
    numpy.stack
    scores.detach.cpu.numpy
    self.block17
    scores.detach.cpu
    os.path.dirname
    self.conv2
    displacement.detach.cpu
    centermap.min.max
    int
    numpy.save
    model_graph
    self.state_dict.update
    zip
    json_content.append
    _func.focal_neg_loss_with_logits
    flask.Flask.route
    tensorflow.lite.Interpreter.get_tensor
    F.interpolate
    sys.path.append
    torch.where
    torch.from_numpy
    cv2.rotate
    merged_segments.append
    numpy.sum
    precisions.append
    ValueError
    numpy.zeros
    _make_divisible
    get_dataset
    init_worker
    ptss.detach.cpu.numpy.detach
    flipped_lines.append
    self.init_resize_image
    BlockTypeB
    new_hough.current_hough.all
    self.MobileNetV2.super.__init__
    self.block19
    sol_lines_512_all_tensor_list.append
    numpy.cumsum
    mlsd_pytorch.utils.meter.AverageMeter.update
    self.conv1
    get_ext_lines.append
    

    @developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.

    opened by PyDeps 1
  • Is there any way to reduce the GPU memory usage and enhance the inference speed?

    Is there any way to reduce the GPU memory usage and enhance the inference speed?

    The M-LSD's pred_lines takes a long time than I expected, about ~6Hz (including other stuff; M-LSD-tiny only seems to be about 10Hz).

    And it takes about 2G of GPU memory.

    Is there a way to reduce the GPU memory usage and enhance the inference speed? (including TensorRT, etc.)

    Please give me an adivce as I'm not an expert of this.

    Thanks!

    opened by JinraeKim 6
  • some question about junction map

    some question about junction map

    Hi there! Thanks for your excellent work, but I notice that the dimension of junction map is (h, w, 1), but the others are (c, h ,w), and in phase of loading label, it didn't change the dimension. I wonder should it be this way or there is something I missed?

     def gen_junction_and_line_mask(norm_lines, h = 256, w = 256):
    
              junction_map = np.zeros((h, w, 1), dtype=np.float32)
              line_map = np.zeros((h, w, 1), dtype=np.float32)
    
    def load_label(self, ann, do_aug):
    
         label[14, :, :] = junction_map[0]
    
            label[15, :, :] = line_map[0]
    
    opened by iifeve 0
  • Print statement

    Print statement

    Hi guys, thanks for the great repo. Can you please remove the print statement in utils.py (print(max_acc_map.shape))

    https://github.com/lhwcv/mlsd_pytorch/blob/41d5030cc0704acde60d72f110f7b1a3fbebca48/utils.py#L183

    Thanks!

    opened by chemeng 1
Owner
null
ALBERT-pytorch-implementation - ALBERT pytorch implementation

ALBERT-pytorch-implementation developing... 모델의 개념이해를 돕기 위한 구현물로 현재 변수명을 상세히 적었고

BG Kim 3 Oct 6, 2022
An essential implementation of BYOL in PyTorch + PyTorch Lightning

Essential BYOL A simple and complete implementation of Bootstrap your own latent: A new approach to self-supervised Learning in PyTorch + PyTorch Ligh

Enrico Fini 48 Sep 27, 2022
RealFormer-Pytorch Implementation of RealFormer using pytorch

RealFormer-Pytorch Implementation of RealFormer using pytorch. Includes comparison with classical Transformer on image classification task (ViT) wrt C

Simo Ryu 90 Dec 8, 2022
A PyTorch implementation of the paper Mixup: Beyond Empirical Risk Minimization in PyTorch

Mixup: Beyond Empirical Risk Minimization in PyTorch This is an unofficial PyTorch implementation of mixup: Beyond Empirical Risk Minimization. The co

Harry Yang 121 Dec 17, 2022
A pytorch implementation of Pytorch-Sketch-RNN

Pytorch-Sketch-RNN A pytorch implementation of https://arxiv.org/abs/1704.03477 In order to draw other things than cats, you will find more drawing da

Alexis David Jacq 172 Dec 12, 2022
PyTorch implementation of Advantage async actor-critic Algorithms (A3C) in PyTorch

Advantage async actor-critic Algorithms (A3C) in PyTorch @inproceedings{mnih2016asynchronous, title={Asynchronous methods for deep reinforcement lea

LEI TAI 111 Dec 8, 2022
Pytorch-diffusion - A basic PyTorch implementation of 'Denoising Diffusion Probabilistic Models'

PyTorch implementation of 'Denoising Diffusion Probabilistic Models' This reposi

Arthur Juliani 76 Jan 7, 2023
Fang Zhonghao 13 Nov 19, 2022
RETRO-pytorch - Implementation of RETRO, Deepmind's Retrieval based Attention net, in Pytorch

RETRO - Pytorch (wip) Implementation of RETRO, Deepmind's Retrieval based Attent

Phil Wang 556 Jan 4, 2023
HashNeRF-pytorch - Pure PyTorch Implementation of NVIDIA paper on Instant Training of Neural Graphics primitives

HashNeRF-pytorch Instant-NGP recently introduced a Multi-resolution Hash Encodin

Yash Sanjay Bhalgat 616 Jan 6, 2023
Generic template to bootstrap your PyTorch project with PyTorch Lightning, Hydra, W&B, and DVC.

NN Template Generic template to bootstrap your PyTorch project. Click on Use this Template and avoid writing boilerplate code for: PyTorch Lightning,

Luca Moschella 520 Dec 30, 2022
A PyTorch Extension: Tools for easy mixed precision and distributed training in Pytorch

This repository holds NVIDIA-maintained utilities to streamline mixed precision and distributed training in Pytorch. Some of the code here will be included in upstream Pytorch eventually. The intention of Apex is to make up-to-date utilities available to users as quickly as possible.

NVIDIA Corporation 6.9k Jan 3, 2023
Objective of the repository is to learn and build machine learning models using Pytorch. 30DaysofML Using Pytorch

30 Days Of Machine Learning Using Pytorch Objective of the repository is to learn and build machine learning models using Pytorch. List of Algorithms

Mayur 119 Nov 24, 2022
Pretrained SOTA Deep Learning models, callbacks and more for research and production with PyTorch Lightning and PyTorch

Pretrained SOTA Deep Learning models, callbacks and more for research and production with PyTorch Lightning and PyTorch

Pytorch Lightning 1.4k Jan 1, 2023
Amazon Forest Computer Vision: Satellite Image tagging code using PyTorch / Keras with lots of PyTorch tricks

Amazon Forest Computer Vision Satellite Image tagging code using PyTorch / Keras Here is a sample of images we had to work with Source: https://www.ka

Mamy Ratsimbazafy 360 Dec 10, 2022
The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch.

This is a curated list of tutorials, projects, libraries, videos, papers, books and anything related to the incredible PyTorch. Feel free to make a pu

Ritchie Ng 9.2k Jan 2, 2023
Amazon Forest Computer Vision: Satellite Image tagging code using PyTorch / Keras with lots of PyTorch tricks

Amazon Forest Computer Vision Satellite Image tagging code using PyTorch / Keras Here is a sample of images we had to work with Source: https://www.ka

Mamy Ratsimbazafy 359 Jan 5, 2023
A bunch of random PyTorch models using PyTorch's C++ frontend

PyTorch Deep Learning Models using the C++ frontend Gettting started Clone the repo 1. https://github.com/mrdvince/pytorchcpp 2. cd fashionmnist or

Vince 0 Jul 13, 2021
PyTorch Autoencoders - Implementing a Variational Autoencoder (VAE) Series in Pytorch.

PyTorch Autoencoders Implementing a Variational Autoencoder (VAE) Series in Pytorch. Inspired by this repository Model List check model paper conferen

Subin An 8 Nov 21, 2022