Skip to content

Commit

Permalink
[Enhancement] Deprecate file_client_args and use backend_args instead (
Browse files Browse the repository at this point in the history
…open-mmlab#1765)

* tmp commit

* remove
  • Loading branch information
gaotongxiao authored Mar 20, 2023
1 parent 63a6ed4 commit 9caacc7
Show file tree
Hide file tree
Showing 39 changed files with 144 additions and 300 deletions.
12 changes: 2 additions & 10 deletions configs/textdet/dbnet/_base_dbnet_resnet18_fpnc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
file_client_args = dict(backend='disk')

model = dict(
type='DBNet',
backbone=dict(
Expand Down Expand Up @@ -27,10 +25,7 @@
pad_size_divisor=32))

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand All @@ -55,10 +50,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1333, 736), keep_ratio=True),
dict(
type='LoadOCRAnnotations',
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/dbnet/_base_dbnet_resnet50-dcnv2_fpnc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
file_client_args = dict(backend='disk')

model = dict(
type='DBNet',
backbone=dict(
Expand Down Expand Up @@ -29,10 +27,7 @@
pad_size_divisor=32))

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_bbox=True,
Expand All @@ -57,10 +52,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(4068, 1024), keep_ratio=True),
dict(
type='LoadOCRAnnotations',
Expand Down
7 changes: 1 addition & 6 deletions configs/textdet/dbnet/dbnet_resnet18_fpnc_100k_synthtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
'../_base_/schedules/schedule_sgd_100k.py',
]

file_client_args = dict(backend='disk')

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/dbnet/dbnet_resnet18_fpnc_1200e_totaltext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,8 @@
'../_base_/schedules/schedule_sgd_1200e.py',
]

file_client_args = dict(backend='disk')

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand All @@ -37,10 +32,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1333, 736), keep_ratio=True),
dict(
type='LoadOCRAnnotations',
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/drrg/_base_drrg_resnet50_fpn-unet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
file_client_args = dict(backend='disk')

model = dict(
type='DRRG',
backbone=dict(
Expand Down Expand Up @@ -29,10 +27,7 @@
pad_size_divisor=32))

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_bbox=True,
Expand Down Expand Up @@ -82,10 +77,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1024, 640), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/fcenet/_base_fcenet_resnet50_fpn.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
file_client_args = dict(backend='disk')

model = dict(
type='FCENet',
backbone=dict(
Expand Down Expand Up @@ -41,10 +39,7 @@
pad_size_divisor=32))

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand Down Expand Up @@ -96,10 +91,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(2260, 2260), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@
dict(type='PolyLR', power=0.9, eta_min=1e-7, end=1500),
]

file_client_args = dict(backend='disk')
# dataset settings
ctw1500_textdet_train = _base_.ctw1500_textdet_train
ctw1500_textdet_test = _base_.ctw1500_textdet_test

# test pipeline for CTW1500
ctw_test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1080, 736), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/maskrcnn/_base_mask-rcnn_resnet50_fpn.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
_base_ = ['mmdet::_base_/models/mask-rcnn_r50_fpn.py']

file_client_args = dict(backend='disk')

mask_rcnn = _base_.pop('model')
# Adapt Mask R-CNN model to OCR task
mask_rcnn.update(
Expand All @@ -18,10 +16,7 @@
model = dict(type='MMDetWrapper', text_repr_type='poly', cfg=mask_rcnn)

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand Down Expand Up @@ -49,10 +44,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1920, 1920), keep_ratio=True),
dict(
type='LoadOCRAnnotations',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@

# test pipeline for CTW1500
ctw_test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=dict(backend='disk'),
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1600, 1600), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
Expand Down
11 changes: 2 additions & 9 deletions configs/textdet/panet/_base_panet_resnet18_fpem-ffm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@
),
postprocessor=dict(type='PANPostprocessor', text_repr_type='quad')))

file_client_args = dict(backend='disk')
train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand All @@ -60,10 +56,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
# TODO Replace with mmcv.RescaleToShort when it's ready
dict(
type='ShortScaleAspectJitter',
Expand Down
11 changes: 2 additions & 9 deletions configs/textdet/panet/panet_resnet18_fpem-ffm_600e_ctw1500.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@

default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=20), )

file_client_args = dict(backend='disk')
train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand All @@ -37,10 +33,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
# TODO Replace with mmcv.RescaleToShort when it's ready
dict(
type='ShortScaleAspectJitter',
Expand Down
11 changes: 2 additions & 9 deletions configs/textdet/panet/panet_resnet50_fpem-ffm_600e_icdar2017.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@

default_hooks = dict(checkpoint=dict(type='CheckpointHook', interval=20), )

file_client_args = dict(backend='disk')
train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand All @@ -35,10 +31,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
# TODO Replace with mmcv.RescaleToShort when it's ready
dict(
type='ShortScaleAspectJitter',
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/psenet/_base_psenet_resnet50_fpnf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
file_client_args = dict(backend='disk')

model = dict(
type='PSENet',
backbone=dict(
Expand Down Expand Up @@ -32,10 +30,7 @@
pad_size_divisor=32))

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_polygon=True,
Expand All @@ -58,10 +53,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(2240, 2240), keep_ratio=True),
dict(
type='LoadOCRAnnotations',
Expand Down
5 changes: 1 addition & 4 deletions configs/textdet/psenet/psenet_resnet50_fpnf_600e_ctw1500.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
ctw1500_textdet_test = _base_.ctw1500_textdet_test

test_pipeline_ctw = [
dict(
type='LoadImageFromFile',
file_client_args=_base_.file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1280, 1280), keep_ratio=True),
dict(
type='LoadOCRAnnotations',
Expand Down
12 changes: 2 additions & 10 deletions configs/textdet/textsnake/_base_textsnake_resnet50_fpn-unet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
file_client_args = dict(backend='disk')

model = dict(
type='TextSnake',
backbone=dict(
Expand Down Expand Up @@ -28,10 +26,7 @@
pad_size_divisor=32))

train_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(
type='LoadOCRAnnotations',
with_bbox=True,
Expand Down Expand Up @@ -72,10 +67,7 @@
]

test_pipeline = [
dict(
type='LoadImageFromFile',
file_client_args=file_client_args,
color_type='color_ignore_orientation'),
dict(type='LoadImageFromFile', color_type='color_ignore_orientation'),
dict(type='Resize', scale=(1333, 736), keep_ratio=True),
# add loading annotation after ``Resize`` because ground truth
# does not need to do resize data transform
Expand Down
Loading

0 comments on commit 9caacc7

Please sign in to comment.