Skip to content

Commit bfe01d5

Browse files
authored
Update README.md
1 parent 9d50168 commit bfe01d5

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ python predict.py --input datasets/data/cityscapes/leftImg8bit/train/bremen --d
5555

5656
Please refer to [this commit (Xception)](https://github.com/VainF/DeepLabV3Plus-Pytorch/commit/c4b51e435e32b0deba5fc7c8ff106293df90590d) for more details about how to add new backbones.
5757

58+
### 7. New datasets
59+
60+
You can train deeplab models on your own datasets. Your ``torch.utils.data.Dataset`` should provide the following class methods for visualization, just like the [Cityscapes Dataset](https://github.com/VainF/DeepLabV3Plus-Pytorch/blob/9d501682bca56d3b7c1f54c7b73ef99d8a7747d9/datasets/cityscapes.py#L105):
61+
```python
62+
@classmethod
63+
def encode_target(cls, target):
64+
return cls.id_to_train_id[np.array(target)]
65+
66+
@classmethod
67+
def decode_target(cls, target):
68+
target[target == 255] = 19
69+
return cls.train_id_to_color[target]
70+
```
71+
72+
5873
## Results
5974

6075
### 1. Performance on Pascal VOC2012 Aug (21 classes, 513 x 513)

0 commit comments

Comments
 (0)