Skip to content

refactor pre- and post-processing modules #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 0 additions & 152 deletions configs/det/db++_r50_icdar15.yaml

This file was deleted.

33 changes: 18 additions & 15 deletions configs/det/db_r50_icdar15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ model:
name: DBFPN
out_channels: 256
bias: False
use_asf: False # enable it for DB++
use_asf: False # enable it for DB++
head:
name: DBHead
k: 50
Expand All @@ -26,11 +26,11 @@ model:

postprocess:
name: DBPostprocess
region_type: 'quad'
thresh: 0.3
box_thresh: 0.55 # TODO: this value is 0.55 in modelzoo and but 0.7 in paddle
output_polygon: False # whether to output a polygon or a box
binary_thresh: 0.3 # binarization threshold
box_thresh: 0.6 # box score threshold
max_candidates: 1000
unclip_ratio: 1.5
expand_ratio: 1.5 # coefficient for expanding predictions

metric:
name: DetMetric
Expand Down Expand Up @@ -70,12 +70,12 @@ train:
shuffle: True
transform_pipeline:
- DecodeImage:
img_mode: BGR
img_mode: RGB
to_float32: False
- DetLabelEncode:
- MZResizeByGrid:
divisor: 32
transform_polys: True # originally in modelzoo, it doesn't transform polys
transform_polys: True
- MZRandomScaleByShortSide:
short_side: 736
- IaaAugment:
Expand All @@ -86,10 +86,10 @@ train:
max_tries: 100
min_crop_side_ratio: 0.1
crop_size: [ 640, 640 ]
- MZMakeSegDetectionData:
- ShrinkBinaryMap:
min_text_size: 8
shrink_ratio: 0.4
- MZMakeBorderMap:
- BorderMap:
shrink_ratio: 0.4
thresh_min: 0.3
thresh_max: 0.7
Expand All @@ -98,13 +98,13 @@ train:
saturation: 0.5
to_numpy: True
- NormalizeImage:
bgr_to_rgb: True
bgr_to_rgb: False
is_hwc: True
mean: imagenet
std: imagenet
- ToCHWImage:
# the order of the dataloader list, matching the network input and the input labels for the loss function, and optional data for debug/visaulize
output_keys: ['image', 'shrink_map', 'shrink_mask', 'threshold_map', 'threshold_mask'] #'img_path']
output_keys: ['image', 'binary_map', 'mask', 'thresh_map', 'thresh_mask'] #'img_path']
#output_keys: ['image'] # for debug op performance
num_keys_to_net: 1 # num inputs for network forward func in output_keys
# keys_for_loss: 4 # num labels for loss func
Expand All @@ -113,7 +113,7 @@ train:
shuffle: True # TODO: tbc
batch_size: 20
drop_remainder: False
max_rowsize: 20
max_rowsize: 32
num_workers: 10 # TODO: may lead to OOM

eval:
Expand All @@ -125,17 +125,20 @@ eval:
label_file: ic15/text_localization/test/test_icdar2015_label.txt
#data_dir: /Users/Samit/Data/datasets/ic15/det/test
#label_file: /Users/Samit/Data/datasets/ic15/det/test/test_icdar2015_label.txt
sample_ratio 1.0 ]
sample_ratio: [ 1.0 ]
shuffle: False
transform_pipeline:
- DecodeImage:
img_mode: BGR
img_mode: RGB
to_float32: False
- DetLabelEncode:
- MZResizeByGrid:
divisor: 32
transform_polys: True
- MZScalePad:
eval_size: [ 736, 1280 ] # h, w
- NormalizeImage:
bgr_to_rgb: True
bgr_to_rgb: False
is_hwc: True
mean: imagenet
std: imagenet
Expand Down
Loading