Giter VIP home page Giter VIP logo

allentdan / libtorchsegmentation Goto Github PK

View Code? Open in Web Editor NEW
402.0 10.0 85.0 90.49 MB

A c++ trainable semantic segmentation library based on libtorch (pytorch c++). Backbone: VGG, ResNet, ResNext. Architecture: FPN, U-Net, PAN, LinkNet, PSPNet, DeepLab-V3, DeepLab-V3+ by now.

License: MIT License

C++ 97.32% CMake 0.32% C 2.34% Python 0.02%
semantic-segmentation fpn pytorch-cpp libtorch resnet resnext unet deeplabv3 deeplabv3plus cpp

libtorchsegmentation's People

Contributors

0x0000dead avatar allentdan avatar bigbigxing823 avatar huke3014 avatar leonelhs avatar zhongqingyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libtorchsegmentation's Issues

Instance Segmentation

It was very helpful to implement segmentation using libTorch with C++. Thank you.
I'm trying to implement Mask R-CNN for Instance Segmentation, but I'm not fully familiar with LibTorch yet, so I'm having a hard time.
I'd like to include it in your code, so could you give me some hints?

对象定位的问题?

您好,我要问一下,提供的例子里面支持定位吗?比如给的image预测里面,图中有两个人,我能否把她们识别并且分别标注出来呢?
image
图中框出两人的大致轮廓。

UNet++ model

Hi! Great repo!

I was exactly looking for a C++ interface to Qubvel pytorch models. Is there any possibility that you will provide the interface for the Unet++ model with SE-ResNet-50 encoder?

Thank you!

Using DeepLabV3+?

Hi, and thank you very much for making this code available. Very helpful!

I have the examples running great, but now I would like to train and use DeepLabV3+ model.

How do I generate weights and train using this model?

Thanks!

关于模型结构

你好,看了下unet结构的实施,几个问题请教下:

  • 分割头上最后为什么还接了一层upsample,按道理conv出来的特征就是(b,n_class,h,w)已经恢复到原图大小了,那这层上采样貌似不是必要的。
  • dice_loss的实现:发现dice_coef的公式用了dice_coef=inter/(pred_area + label_area - inter),但这不是iou的公式吗?dice_coef不是应该等于2*inter/(pred_area + label_area)吗?

Adding DANNet to the supported Archs

Hi, Great work guys!

This is a great work indeed and I would like to contribute into it by adding a support for another network. https://github.com/W-zx-Y/DANNet. Could you let me know the process and where is better to start? I'm sure you have done this before so I could use your experience instead of going completely on my own.

Thanks!

关于读入预训练模型的一些问题

您好!学习了您的基于libtorch写的语义分割算法,我感觉收益匪浅。
在源码上还有一些问题希望能得到解答。在预测的时候看到initialize读入了resnet34.pt模型,然后在LoadWeight时又读取了segmentor.pt模型,这两个模型是一样的吗?在读入segmentor.pt时model这个类参数是不是会被覆盖,如果会被覆盖的话之前读入的resnet34这个模型好像没有必要?还有一个问题就是,训练的时候也要读入骨干网络的预训练模型,训练后保存的模型是不是已经包括了骨干网络,或者是只有一个分割头,骨干网络沿用预训练的网络参数?

还望您百忙之中能够解答,非常感谢!

请问可以增加solov2的教程吗,球球了

非常感谢大佬开源这个项目,这对于想在C++上利用libtorch部署的人的帮助真的很大。
最近在研究solov2,但网上很多资料都是基于python的,而关于在C++上部署的非常少,不知道大佬可不可以出个相关的教程指导一下?可能这要求有点过分啦哈哈哈,但还是希望大佬能考虑一下

build issue for linux

Hi,

Firstly, thank you for sharing this project. It would be very helpful to work with Pytorch in C++ using this library.

I tried to build the project using the commands mentioned as follows:
cd build
cmake ..
make
./LibtorchSegmentation

The "cmake .." command is executed successfully. However, the "make" command shows an error message "make: *** No targets specified and no makefile found. Stop."
There is no makefile in the LibtorchSegmentation project directory. And therefore, there is no LibtorchSegmentation file generated in the build directory.

Please would you let me know how I can work around this?

Thanks!

How to enable GPU inference and how t train for multiple objects

Hi,

Thank you so much for your support with my last issue.
Now I can able to run run the given code in Linux platform also.

Please let me know how to do inference with GPU.
When try to do inference using video input it is very slow. Hope GPU usage will improve the efficiency.

It is possible to train multiple objects like people, animals etc.. in a model.

Thanks and regards,
Prabhakar M

cuda

Can training be accelerated using CUDA? If so, how can it be done?

训练自己的模型

1、加载的预训练模型resnet34 训练自己的数据集 train loss 和val loss 训练几轮就变成0
2、然后有训练集的图像进行测试 结果全黑

Please provide cmake

I am trying run this code in ubuntu OS but it is giving some file missing error. Kindly share me cmake file for the given post.

make problem

(py37) ql@ql:~/projects/LibtorchSegmentation-main/test/build$ make
Scanning dependencies of target resnet34
[ 25%] Building CXX object CMakeFiles/resnet34.dir/resnet34.cpp.o
make[2]: *** 没有规则可制作目标“/usr/local/cuda-11.3/lib64/libcudart.so/usr/local/cuda-11.3/lib64/libcublas.so”,由“resnet34” 需求。 停止。
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/resnet34.dir/all' failed
make[1]: *** [CMakeFiles/resnet34.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

模型加载参数问题

大佬,看你的博客收获巨多,谢谢大佬!
我自己用C++搭的模型加载python训练的参数pth文件一直报错,求教!

version of python

Hi,
Thanks for your code.

Could you include your code impllemented by python ?
Thanks!

How to train on custom dataset without json file?

Hi, my dataset has images and corresponding masks, but it has no json files. The dataset folders just like below:

Dataset
├── train
│   ├── 0.png
│   ├── 0_mask.png
│   └......
├── val
│   ├── 3.png
│   ├── 3_mask.png
│   └......

May I ask how to train on this dataset without json file?
Thanks!

network

Author, I have a question for you. I want to change the network to UNet, and change the FPN in the train.cpp and resnet34.cpp files to UNet, but the training error occurs. I changed to PAN and it works. Do you know what the reason is. thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.