0%

TorchSeg - HUST's Semantic Segmentation algorithms in PyTorch

Happily got the info that my master's supervisor's lab, namely: The State-Level key Laboratory of Multispectral Signal Processing in Huazhong University of Science and Technology released TorchSeg just yesterday. I can't helping testing it out.

Preparation

Python Packages

According to the README.md on TorchSeg, serveral packages need to be prepared FIRST:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
➜  ~ pip show torch
Name: torch
Version: 1.1.0a0+b6a8c45
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: /home/jiapei/.local/lib/python3.6/site-packages
Requires:
Required-by: torchvision, torchtext, torchgan, pytorch-pretrained-bert, pyro-ppl, flair, autokeras
➜ ~ pip show torchvision
Name: torchvision
Version: 0.2.1
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Author: PyTorch Core Team
Author-email: soumith@pytorch.org
License: BSD
Location: /home/jiapei/.local/lib/python3.6/site-packages
Requires: numpy, torch, pillow, six
Required-by: torchgan, torchfusion, autokeras
➜ ~ pip show easydict
Name: easydict
Version: 1.9
Summary: Access dict values as attributes (works recursively).
Home-page: https://github.com/makinacorpus/easydict
Author: Mathieu Leplatre
Author-email: mathieu.leplatre@makina-corpus.com
License: LPGL, see LICENSE file.
Location: /home/jiapei/.local/lib/python3.6/site-packages
Requires:
Required-by: luminoth
➜ ~ pip show apex
Name: apex
Version: 0.1
Summary: PyTorch Extensions written by NVIDIA
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Location: /home/jiapei/.local/lib/python3.6/site-packages/apex-0.1-py3.6.egg
Requires:
Required-by:
➜ ~ pip show tqdm
Name: tqdm
Version: 4.29.1
Summary: Fast, Extensible Progress Meter
Home-page: https://github.com/tqdm/tqdm
Author: Noam Yorav-Raphael
Author-email: noamraph@gmail.com
License: MPLv2.0, MIT Licences
Location: /home/jiapei/.local/lib/python3.6/site-packages
Requires:
Required-by: TPOT, torchtext, torchfusion, thinc, tensorpack, skorch, shap, pytorch-pretrained-bert, pyro-ppl, optimuspyspark, kaggle, flair, autokeras, tf-pose

PyTorch Models

Download all PyTorch models provided from within all .py files from PyTorch Vision Models. Let's briefly summarize the models as follows:

Test

TorchSeg config.py modification

After TorchSeg is checked out, we need to modify all the config.py files and ensure all variables C.pretrained_model are specified to the RIGHT location and with the RIGHT names. In my case, I just downloaded all PyTorch models under the same directory as TorchSeg, therefore, all C.pretrained_model are designated as:

1
2
3
C.pretrained_model = "./resnet18-5c106cde.pth"
C.pretrained_model = "./resnet50-19c8e357.pth"
C.pretrained_model = "./resnet101-5d3b4d8f.pth"

etc.

We also need to modify all variables C.dataset_path and make sure we are using the RIGHT dataset. In fact, ONLY two datasets are directly adopted in the originally checked-out code of TorchSeg.

Currently, it seems there is still some tricks about how to configure these datasets, please refer to my Github issue.