Skip to content

Commit

Permalink
Merge branch 'master' of github.com:alibaba/EasyCV
Browse files Browse the repository at this point in the history
  • Loading branch information
Cathy0908 committed Mar 13, 2023
2 parents 15ca248 + 6036624 commit b39db6d
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 21 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ EasyCV is an all-in-one computer vision toolbox based on PyTorch, mainly focuses


## What's New
[🔥 2023.03.06]

* 06/03/2023 EasyCV v0.10.0 was released.
- Add segmentation model STDC
- Add skeleton based video recognition model STGCN
- Support ReID and Multi-len MOT

[🔥 2023.01.17]

* 17/01/2023 EasyCV v0.9.0 was released.
Expand Down
7 changes: 7 additions & 0 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ EasyCV是一个涵盖多个领域的基于Pytorch的计算机视觉工具箱,


## 最新进展
[🔥 2023.03.06]

* 06/03/2023 EasyCV v0.10.0 was released.
- 增加分割模型STDC
- 增加基于关键点的视频分类模型STGCN
- 支持多镜头多目标跟踪

[🔥 2023.01.17]

* 17/01/2023 EasyCV v0.9.0 was released.
Expand Down
13 changes: 8 additions & 5 deletions configs/detection/fcos/coco_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
train_img_prefix = data_root + 'train2017/'
val_ann_file = data_root + 'annotations/instances_val2017.json'
val_img_prefix = data_root + 'val2017/'
img_scale = (1333, 800)
data_type = 'DetSourceCoco'
test_batch_size = 1

img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)

train_pipeline = [
dict(type='MMResize', img_scale=(1333, 800), keep_ratio=True),
dict(type='MMResize', img_scale=img_scale, keep_ratio=True),
dict(type='MMRandomFlip', flip_ratio=0.5),
dict(type='MMNormalize', **img_norm_cfg),
dict(type='MMPad', size_divisor=32),
Expand All @@ -40,7 +43,7 @@
test_pipeline = [
dict(
type='MMMultiScaleFlipAug',
img_scale=(1333, 800),
img_scale=img_scale,
flip=False,
transforms=[
dict(type='MMResize', keep_ratio=True),
Expand All @@ -61,7 +64,7 @@
train_dataset = dict(
type='DetDataset',
data_source=dict(
type='DetSourceCoco',
type=data_type,
ann_file=train_ann_file,
img_prefix=train_img_prefix,
pipeline=[
Expand All @@ -76,9 +79,9 @@

val_dataset = dict(
type='DetDataset',
imgs_per_gpu=1,
imgs_per_gpu=test_batch_size,
data_source=dict(
type='DetSourceCoco',
type=data_type,
ann_file=val_ann_file,
img_prefix=val_img_prefix,
pipeline=[
Expand Down
4 changes: 1 addition & 3 deletions configs/detection/fcos/fcos_r50_torch_1x_coco.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
_base_ = ['./fcos.py', './coco_detection.py', 'configs/base.py']

log_config = dict(
interval=50,
hooks=[
interval=50, hooks=[
dict(type='TextLoggerHook'),
# dict(type='TensorboardLoggerHook')
])

checkpoint_config = dict(interval=10)
Expand Down
114 changes: 114 additions & 0 deletions configs/detection/fcos/fcos_r50_torch_1x_pai.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
_base_ = ['./fcos.py', 'configs/base.py']

log_config = dict(
interval=50, hooks=[
dict(type='TextLoggerHook'),
])

checkpoint_config = dict(interval=10)
# optimizer
optimizer = dict(
type='SGD',
lr=0.01,
momentum=0.9,
weight_decay=0.0001,
paramwise_options=dict(bias_lr_mult=2., bias_decay_mult=0.))
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='linear',
warmup_iters=500,
warmup_ratio=1.0 / 3,
warmup_by_epoch=False,
step=[8, 11])

total_epochs = 12

find_unused_parameters = False

CLASSES = [
'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train',
'truck', 'boat', 'traffic light', 'fire hydrant', 'stop sign',
'parking meter', 'bench', 'bird', 'cat', 'dog', 'horse', 'sheep', 'cow',
'elephant', 'bear', 'zebra', 'giraffe', 'backpack', 'umbrella', 'handbag',
'tie', 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball', 'kite',
'baseball bat', 'baseball glove', 'skateboard', 'surfboard',
'tennis racket', 'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon',
'bowl', 'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch', 'potted plant',
'bed', 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote',
'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
'refrigerator', 'book', 'clock', 'vase', 'scissors', 'teddy bear',
'hair drier', 'toothbrush'
]

img_scale = (1333, 800)

img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)

train_pipeline = [
dict(type='MMResize', img_scale=img_scale, keep_ratio=True),
dict(type='MMRandomFlip', flip_ratio=0.5),
dict(type='MMNormalize', **img_norm_cfg),
dict(type='MMPad', size_divisor=32),
dict(type='DefaultFormatBundle'),
dict(
type='Collect',
keys=['img', 'gt_bboxes', 'gt_labels'],
meta_keys=('filename', 'ori_filename', 'ori_shape', 'ori_img_shape',
'img_shape', 'pad_shape', 'scale_factor', 'flip',
'flip_direction', 'img_norm_cfg'))
]
test_pipeline = [
dict(
type='MMMultiScaleFlipAug',
img_scale=img_scale,
flip=False,
transforms=[
dict(type='MMResize', keep_ratio=True),
dict(type='MMRandomFlip'),
dict(type='MMNormalize', **img_norm_cfg),
dict(type='MMPad', size_divisor=32),
dict(type='ImageToTensor', keys=['img']),
dict(
type='Collect',
keys=['img'],
meta_keys=('filename', 'ori_filename', 'ori_shape',
'ori_img_shape', 'img_shape', 'pad_shape',
'scale_factor', 'flip', 'flip_direction',
'img_norm_cfg'))
])
]

# dataset settings
data_type = 'DetSourcePAI'
train_path = 'data/coco/train2017.manifest'
val_path = 'data/coco/val2017.manifest'
test_batch_size = 1

train_dataset = dict(
type='DetDataset',
data_source=dict(type=data_type, path=train_path, classes=CLASSES),
pipeline=train_pipeline)

val_dataset = dict(
type='DetDataset',
imgs_per_gpu=test_batch_size,
data_source=dict(type=data_type, path=val_path, classes=CLASSES),
pipeline=test_pipeline)

data = dict(
imgs_per_gpu=2, workers_per_gpu=2, train=train_dataset, val=val_dataset)

# evaluation
eval_config = dict(interval=1, gpu_collect=False)
eval_pipelines = [
dict(
mode='test',
evaluators=[
dict(type='CocoDetectionEvaluator', classes=CLASSES),
],
)
]
20 changes: 9 additions & 11 deletions configs/detection/yolox/yolox_s_8xb16_300e_coco_pai.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,22 @@
dict(type='Collect', keys=['img'])
]

data_type = 'DetSourcePAI'
test_batch_size = 1
train_path = 'data/coco/train2017.manifest'
val_path = 'data/coco/val2017.manifest'

# dataset settings
img_size = 640
train_dataset = dict(
type='DetImagesMixDataset',
data_source=dict(
type='DetSourcePAI',
path='data/coco/train2017.manifest',
classes=CLASSES),
data_source=dict(type=data_type, path=train_path, classes=CLASSES),
pipeline=train_pipeline,
dynamic_scale=img_scale)

val_dataset = dict(
type='DetImagesMixDataset',
imgs_per_gpu=2,
data_source=dict(
type='DetSourcePAI',
path='data/coco/val2017.manifest',
classes=CLASSES),
imgs_per_gpu=test_batch_size,
data_source=dict(type=data_type, path=val_path, classes=CLASSES),
pipeline=test_pipeline,
dynamic_scale=None,
label_padding=False)
Expand All @@ -90,7 +88,7 @@
eval_pipelines = [
dict(
mode='test',
data=data['val'],
data=val_dataset,
evaluators=[dict(type='CocoDetectionEvaluator', classes=CLASSES)],
)
]
26 changes: 26 additions & 0 deletions docs/source/change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# v 0.10.0 (06/03/2023)

## Highlights
- Support STDC, STGCN, ReID and Multi-len MOT.
- Support multi processes for predictor data preprocessing. For the model with more time consuming in data preprocessing, the speedup can reach more than 50%.

## New Features
- Support multi processes for predictor data preprocessing. ([#272](https://github.com/alibaba/EasyCV/pull/272))
- Support STDC model. ([#284](https://github.com/alibaba/EasyCV/pull/284)) ([#286](https://github.com/alibaba/EasyCV/pull/286))
- Support ReID and Multi-len MOT. ([#285](https://github.com/alibaba/EasyCV/pull/285)) ([#295](https://github.com/alibaba/EasyCV/pull/295))
- Support STGCN model, and support export blade model. ([#293](https://github.com/alibaba/EasyCV/pull/293)) ([#299](https://github.com/alibaba/EasyCV/pull/299))
- Add pose model zoo and support export torch jit and blade model for pose models. ([#294](https://github.com/alibaba/EasyCV/pull/294))
- Support train motchallenge and crowdhuman datasets for detection models. ([#265](https://github.com/alibaba/EasyCV/pull/265))

## Improvements
- Speed up inference for face detector when using mtcnn. ([#273](https://github.com/alibaba/EasyCV/pull/273))
- Add mobilenet config for [itag](https://help.aliyun.com/document_detail/311162.html) and imagenet dataset, and optimize `ClsSourceImageList` api to support string label. ([#276](https://github.com/alibaba/EasyCV/pull/276)) ([#283](https://github.com/alibaba/EasyCV/pull/283))
- Support multi-rows replacement for first order parameter. ([#282](https://github.com/alibaba/EasyCV/pull/282))
- Add a tool to convert itag dataset to raw dataset. ([#290](https://github.com/alibaba/EasyCV/pull/290))
- Add `PoseTopDownPredictor` to replace `TorchPoseTopDownPredictorWithDetector` ([#296](https://github.com/alibaba/EasyCV/pull/296))

## Bug Fixes
- Remove git lfs dependencies. ([#278](https://github.com/alibaba/EasyCV/pull/278))
- Fix wholebody keypoints evaluation. ([#287](https://github.com/alibaba/EasyCV/pull/287))
- Fix DetSourceRaw while label file and image file not match. ([#289](https://github.com/alibaba/EasyCV/pull/289))

# v 0.9.0 (17/01/2023)

## Highlights
Expand Down
5 changes: 5 additions & 0 deletions easycv/utils/config_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ def validate_export_config(cfg):
# detection
'YOLOX': 'configs/config_templates/yolox.py',
'YOLOX_ITAG': 'configs/config_templates/yolox_itag.py',
'YOLOX_ITAG_EASY':
'configs/detection/yolox/yolox_s_8xb16_300e_coco_pai.py',
'YOLOX_COCO_EASY': 'configs/detection/yolox/yolox_s_8xb16_300e_coco.py',
'FCOS_ITAG_EASY': 'configs/detection/fcos/fcos_r50_torch_1x_pai.py',
'FCOS_COCO_EASY': 'configs/detection/fcos/fcos_r50_torch_1x_coco.py',

# ssl
'MOCO_R50_TFRECORD': 'configs/config_templates/moco_r50_tfrecord.py',
Expand Down
4 changes: 2 additions & 2 deletions easycv/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# GENERATED VERSION FILE
# TIME: Thu Nov 5 14:17:50 2020

__version__ = '0.9.0'
short_version = '0.9.0'
__version__ = '0.10.0'
short_version = '0.10.0'

0 comments on commit b39db6d

Please sign in to comment.