Skip to content

Commit 8d0fcf9

Browse files
committed
Fix code format problem.
1 parent 6e4c2a7 commit 8d0fcf9

File tree

81 files changed

+950
-425
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+950
-425
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ install:
1111
- pip install -r requirements.txt
1212

1313
script:
14-
- python -c 'import paddleseg'
14+
- /bin/bash legacy/test/ci/check_code_style.sh
1515

1616
notifications:
1717
email:

configs/_base_/pascal_context.yml

-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,3 @@ loss:
4545
types:
4646
- type: CrossEntropyLoss
4747
coef: [1]
48-
49-
50-

configs/dnlnet/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Disentangled Non-local Neural Networks. ECCV (15) 2020: 191-207.
2020
|-|-|-|-|-|-|-|-|
2121
|DNLNet|ResNet50_OS8|512x512|40000|80.89%|81.31%|81.56%|[model](https://paddleseg.bj.bcebos.com/dygraph/pascal_voc12/dnlnet_resnet50_os8_voc12aug_512x512_40k/model.pdparams) \| [log](https://paddleseg.bj.bcebos.com/dygraph/pascal_voc12/dnlnet_resnet50_os8_voc12aug_512x512_40k/train.log) \| [vdl](https://paddlepaddle.org.cn/paddle/visualdl/service/app?id=8877c77bef8b227af22c5eb3017138ce)|
2222
|DNLNet|ResNet101_OS8|512x512|40000|80.49%|80.83%| 81.33%|[model](https://paddleseg.bj.bcebos.com/dygraph/pascal_voc12/dnlnet_resnet101_os8_voc12aug_512x512_40k/model.pdparams) \| [log](https://paddleseg.bj.bcebos.com/dygraph/pascal_voc12/dnlnet_resnet101_os8_voc12aug_512x512_40k/train.log) \| [vdl](https://paddlepaddle.org.cn/paddle/visualdl/service/app?id=1d42c22da1c465d9a38e4204bebeeb54)|
23-

configs/emanet/emanet_resnet101_os8_cityscapes_1024x512_80k.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ model:
1818
concat_input: True
1919
enable_auxiliary_loss: True
2020
align_corners: False
21-
21+
2222
optimizer:
2323
type: sgd
2424
momentum: 0.9
@@ -28,4 +28,4 @@ loss:
2828
types:
2929
- type: CrossEntropyLoss
3030
- type: CrossEntropyLoss
31-
coef: [1, 0.4]
31+
coef: [1, 0.4]

configs/emanet/emanet_resnet101_os8_voc12aug_512x512_40k.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ model:
1414
concat_input: True
1515
enable_auxiliary_loss: True
1616
align_corners: True
17-
17+
1818
optimizer:
1919
type: sgd
2020
momentum: 0.9
@@ -25,4 +25,4 @@ loss:
2525
types:
2626
- type: CrossEntropyLoss
2727
- type: CrossEntropyLoss
28-
coef: [1, 0.4]
28+
coef: [1, 0.4]

configs/emanet/emanet_resnet50_os8_cityscapes_1024x512_80k.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ model:
1818
concat_input: True
1919
enable_auxiliary_loss: True
2020
align_corners: False
21-
21+
2222
optimizer:
2323
type: sgd
2424
momentum: 0.9
@@ -29,4 +29,4 @@ loss:
2929
types:
3030
- type: CrossEntropyLoss
3131
- type: CrossEntropyLoss
32-
coef: [1, 0.4]
32+
coef: [1, 0.4]

configs/emanet/emanet_resnet50_os8_voc12aug_512x512_40k.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ model:
1515
concat_input: True
1616
enable_auxiliary_loss: True
1717
align_corners: True
18-
18+
1919
optimizer:
2020
type: sgd
2121
momentum: 0.9
@@ -27,4 +27,3 @@ loss:
2727
- type: CrossEntropyLoss
2828
- type: CrossEntropyLoss
2929
coef: [1, 0.4]
30-

configs/isanet/isanet_resnet101_os8_cityscapes_769x769_80k.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ loss:
2727
types:
2828
- type: CrossEntropyLoss
2929
- type: CrossEntropyLoss
30-
coef: [1, 0.4]
30+
coef: [1, 0.4]

configs/isanet/isanet_resnet50_os8_cityscapes_769x769_80k.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ loss:
2828
types:
2929
- type: CrossEntropyLoss
3030
- type: CrossEntropyLoss
31-
coef: [1, 0.4]
31+
coef: [1, 0.4]

configs/u2net/u2net_cityscapes_1024x512_160k.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ model:
99
pretrained: Null
1010

1111
loss:
12-
coef: [1, 1, 1, 1, 1, 1, 1]
12+
coef: [1, 1, 1, 1, 1, 1, 1]

configs/u2net/u2netp_cityscapes_1024x512_160k.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ model:
99
pretrained: Null
1010

1111
loss:
12-
coef: [1, 1, 1, 1, 1, 1, 1]
12+
coef: [1, 1, 1, 1, 1, 1, 1]

docs/data_prepare.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Coco Stuff是基于Coco数据集的像素级别语义分割数据集。它主要
6464
|--annotations
6565
| |--train2017
6666
| |--val2017
67-
67+
6868
其中,标注图像的标签从0,1依次取值,不可间隔。若有需要忽略的像素,则按255进行标注。
6969

7070
## 关于Pascal Context数据集
@@ -73,7 +73,7 @@ Pascal Context是基于PASCAL VOC 2010数据集额外标注的像素级别的语
7373

7474
在使用Pascal Context数据集前, 请先下载[VOC2010](http://host.robots.ox.ac.uk/pascal/VOC/voc2010/VOCtrainval_03-May-2010.tar),随后自行前往[Pascal-Context主页](https://www.cs.stanford.edu/~roozbeh/pascal-context/)下载数据集及[标注](https://codalabuser.blob.core.windows.net/public/trainval_merged.json)
7575
我们建议您将数据集存放于`PaddleSeg/data`中,以便与我们配置文件完全兼容。数据集下载后请组织成如下结构:
76-
76+
7777
VOC2010
7878
|
7979
|--Annotations
@@ -87,7 +87,7 @@ Pascal Context是基于PASCAL VOC 2010数据集额外标注的像素级别的语
8787
|--SegmentationObject
8888
|
8989
|--trainval_merged.json
90-
90+
9191
其中,标注图像的标签从1,2依次取值,不可间隔。若有需要忽略的像素,则按0进行标注。在使用Pascal Context数据集时,需要安装[Detail](https://github.com/zhanghang1989/detail-api).
9292

9393
## 自定义数据集

legacy/configs/deeplabv3p_xception65_optic.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ SOLVER:
3131
NUM_EPOCHS: 10
3232
LR: 0.001
3333
LR_POLICY: "poly"
34-
OPTIMIZER: "adam"
34+
OPTIMIZER: "adam"

legacy/contrib/ACE2P/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -74,28 +74,28 @@ python -u infer.py --example ACE2P
7474
**NOTE:** 运行该模型需要2G左右显存。由于数据图片较多,预测过程将比较耗时。
7575

7676
#### 4. 预测结果示例:
77-
77+
7878
原图:
79-
79+
8080
![](imgs/117676_2149260.jpg)
81-
81+
8282
预测结果:
83-
83+
8484
![](imgs/117676_2149260.png)
85-
85+
8686
### 备注
8787

8888
1. 数据及模型路径等详细配置见ACE2P/HumanSeg/RoadLine下的config.py文件
8989
2. ACE2P模型需预留2G显存,若显存超可调小FLAGS_fraction_of_gpu_memory_to_use
9090

9191
## 引用
9292

93-
**论文**
93+
**论文**
9494

9595
*Devil in the Details: Towards Accurate Single and Multiple Human Parsing* https://arxiv.org/abs/1809.05996
9696

9797
**代码**
9898

99-
https://github.com/Microsoft/human-pose-estimation.pytorch
99+
https://github.com/Microsoft/human-pose-estimation.pytorch
100100

101101
https://github.com/liutinglt/CE2P

legacy/contrib/HumanSeg/bg_replace.py

+11-7
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ def infer(args):
124124
raise Exception('The --image_path is not existed: {}'.format(
125125
args.image_path))
126126
if args.background_image_path is None:
127-
raise Exception('The --background_image_path is not set. Please set it')
127+
raise Exception(
128+
'The --background_image_path is not set. Please set it')
128129
else:
129130
if not osp.exists(args.background_image_path):
130-
raise Exception('The --background_image_path is not existed: {}'.format(
131-
args.background_image_path))
131+
raise Exception(
132+
'The --background_image_path is not existed: {}'.format(
133+
args.background_image_path))
132134
img = cv2.imread(args.image_path)
133135
score_map, im_info = predict(img, model, test_transforms)
134136
score_map = score_map[:, :, 1]
@@ -144,13 +146,15 @@ def infer(args):
144146
is_video_bg = False
145147
if args.background_video_path is not None:
146148
if not osp.exists(args.background_video_path):
147-
raise Exception('The --background_video_path is not existed: {}'.format(
148-
args.background_video_path))
149+
raise Exception(
150+
'The --background_video_path is not existed: {}'.format(
151+
args.background_video_path))
149152
is_video_bg = True
150153
elif args.background_image_path is not None:
151154
if not osp.exists(args.background_image_path):
152-
raise Exception('The --background_image_path is not existed: {}'.format(
153-
args.background_image_path))
155+
raise Exception(
156+
'The --background_image_path is not existed: {}'.format(
157+
args.background_image_path))
154158
else:
155159
raise Exception(
156160
'Please offer backgound image or video. You should set --backbground_iamge_paht or --background_video_path'

legacy/contrib/LaneNet/README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ LaneNet
6565

6666
```yaml
6767
# 数据集配置
68-
DATASET:
68+
DATASET:
6969
DATA_DIR: "./dataset/tusimple_lane_detection"
7070
IMAGE_TYPE: "rgb" # choice rgb or rgba
7171
NUM_CLASSES: 2
@@ -79,14 +79,14 @@ MODEL:
7979
MODEL_NAME: "lanenet"
8080

8181
# 其他配置
82-
EVAL_CROP_SIZE: (512, 256)
82+
EVAL_CROP_SIZE: (512, 256)
8383
TRAIN_CROP_SIZE: (512, 256)
84-
AUG:
84+
AUG:
8585
AUG_METHOD: u"unpadding" # choice unpadding rangescaling and stepscaling
8686
FIX_RESIZE_SIZE: (512, 256) # (width, height), for unpadding
8787
MIRROR: False
88-
RICH_CROP:
89-
ENABLE: False
88+
RICH_CROP:
89+
ENABLE: False
9090
BATCH_SIZE: 4
9191
TEST:
9292
TEST_MODEL: "./saved_model/lanenet/final/"
@@ -127,12 +127,10 @@ TEST.TEST_MODEL pretrained_models/LaneNet_vgg_tusimple/
127127
```
128128

129129
可视化结果示例:
130-
130+
131131
预测结果:<br/>
132132
![](imgs/0005_pred_lane.png)
133133
分割结果:<br/>
134134
![](imgs/0005_pred_binary.png)<br/>
135135
车道线实例预测结果:<br/>
136136
![](imgs/0005_pred_instance.png)
137-
138-

legacy/contrib/LaneNet/configs/lanenet.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
EVAL_CROP_SIZE: (512, 256) # (width, height), for unpadding rangescaling and stepscaling
22
TRAIN_CROP_SIZE: (512, 256) # (width, height), for unpadding rangescaling and stepscaling
3-
AUG:
3+
AUG:
44
AUG_METHOD: u"unpadding" # choice unpadding rangescaling and stepscaling
55
FIX_RESIZE_SIZE: (512, 256) # (width, height), for unpadding
66
INF_RESIZE_VALUE: 500 # for rangescaling
@@ -10,15 +10,15 @@ AUG:
1010
MIN_SCALE_FACTOR: 0.5 # for stepscaling
1111
SCALE_STEP_SIZE: 0.25 # for stepscaling
1212
MIRROR: False
13-
RICH_CROP:
14-
ENABLE: False
13+
RICH_CROP:
14+
ENABLE: False
1515

1616
BATCH_SIZE: 4
1717

18-
DATALOADER:
18+
DATALOADER:
1919
BUF_SIZE: 256
2020
NUM_WORKERS: 4
21-
DATASET:
21+
DATASET:
2222
DATA_DIR: "./dataset/tusimple_lane_detection"
2323
IMAGE_TYPE: "rgb" # choice rgb or rgba
2424
NUM_CLASSES: 2
@@ -49,4 +49,3 @@ SOLVER:
4949
LR_POLICY: "poly"
5050
OPTIMIZER: "sgd"
5151
WEIGHT_DECAY: 0.001
52-

legacy/contrib/LaneNet/models/modeling/lanenet.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def ENet_stage2(inputs, name_scope='stage2_block'):
355355
filter_size=3,
356356
regularizer_prob=0.1,
357357
type=DILATED,
358-
dilation_rate=(2 ** (2 * i + 1)),
358+
dilation_rate=(2**(2 * i + 1)),
359359
name_scope='bottleneck2_{}'.format(str(4 * i + 2)))
360360
with scope('bottleneck2_{}'.format(str(4 * i + 3))):
361361
net = bottleneck(
@@ -372,7 +372,7 @@ def ENet_stage2(inputs, name_scope='stage2_block'):
372372
filter_size=3,
373373
regularizer_prob=0.1,
374374
type=DILATED,
375-
dilation_rate=(2 ** (2 * i + 2)),
375+
dilation_rate=(2**(2 * i + 2)),
376376
name_scope='bottleneck2_{}'.format(str(4 * i + 4)))
377377
return net, inputs_shape_2
378378

@@ -394,7 +394,7 @@ def ENet_stage3(inputs, name_scope='stage3_block'):
394394
filter_size=3,
395395
regularizer_prob=0.1,
396396
type=DILATED,
397-
dilation_rate=(2 ** (2 * i + 1)),
397+
dilation_rate=(2**(2 * i + 1)),
398398
name_scope='bottleneck3_{}'.format(str(4 * i + 1)))
399399
with scope('bottleneck3_{}'.format(str(4 * i + 2))):
400400
net = bottleneck(
@@ -411,7 +411,7 @@ def ENet_stage3(inputs, name_scope='stage3_block'):
411411
filter_size=3,
412412
regularizer_prob=0.1,
413413
type=DILATED,
414-
dilation_rate=(2 ** (2 * i + 2)),
414+
dilation_rate=(2**(2 * i + 2)),
415415
name_scope='bottleneck3_{}'.format(str(4 * i + 3)))
416416
return net
417417

legacy/contrib/MechanicalIndustryMeter/unet_mechanical_meter.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
EVAL_CROP_SIZE: (2049, 1537) # (width, height), for unpadding rangescaling and stepscaling
22
TRAIN_CROP_SIZE: (769, 769) # (width, height), for unpadding rangescaling and stepscaling
3-
AUG:
3+
AUG:
44
AUG_METHOD: u"stepscaling" # choice unpadding rangescaling and stepscaling
55
FIX_RESIZE_SIZE: (640, 640) # (width, height), for unpadding
66
INF_RESIZE_VALUE: 500 # for rangescaling
@@ -10,17 +10,17 @@ AUG:
1010
MIN_SCALE_FACTOR: 0.5 # for stepscaling
1111
SCALE_STEP_SIZE: 0.25 # for stepscaling
1212
MIRROR: True
13-
RICH_CROP:
14-
ENABLE: False
13+
RICH_CROP:
14+
ENABLE: False
1515

1616
BATCH_SIZE: 2
1717
MEAN: [0.5, 0.5, 0.5]
1818
STD: [0.5, 0.5, 0.5]
1919

20-
DATALOADER:
20+
DATALOADER:
2121
BUF_SIZE: 256
2222
NUM_WORKERS: 4
23-
DATASET:
23+
DATASET:
2424
DATA_DIR: "./contrib/MechanicalIndustryMeter/mini_mechanical_industry_meter_data/"
2525
IMAGE_TYPE: "rgb" # choice rgb or rgba
2626
NUM_CLASSES: 5

legacy/contrib/NeurIPS_SN7/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Download data from one of following links:
1010

1111
option 1: The official dataset link: https://spacenet.ai/sn7-challenge/
1212

13-
option 2: The BaiduYun [link](https://pan.baidu.com/s/1WM0IHup5Uau7FZGQf7rzdA), the access code: 17th
13+
option 2: The BaiduYun [link](https://pan.baidu.com/s/1WM0IHup5Uau7FZGQf7rzdA), the access code: 17th
1414

1515
### 3. Deployment Guide
1616

0 commit comments

Comments
 (0)