Skip to content
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

Update from dev branch: v0.2.1 release #441

Merged
merged 110 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
69279c5
Split train only in exist train and not exist valid
illian01 Apr 16, 2024
88051f5
Move data split loading logic to BaseDataSampler
illian01 Apr 16, 2024
840a370
Update loading logic for all tasks
illian01 Apr 16, 2024
acc4527
Move load_custom_class_map into class method
illian01 Apr 16, 2024
22b687c
Rename DataSampler to SampleLoader
illian01 Apr 16, 2024
9a79e0e
Fix renamed import
illian01 Apr 16, 2024
86a83b2
Remove unuse test_with_label
illian01 Apr 16, 2024
2d2e704
Move collate functions to util
illian01 Apr 16, 2024
5a1fdff
Compress detection data modules to one file
illian01 Apr 16, 2024
77859e9
Rename get_label to get_detection_label
illian01 Apr 16, 2024
ad7e369
Compress classification data modules to one file
illian01 Apr 16, 2024
c3aca76
Compress segmentation data modules to one file
illian01 Apr 16, 2024
9a2236c
Compress pose estimation data modules to one file
illian01 Apr 16, 2024
5b6e7ad
Remove unused
illian01 Apr 16, 2024
65fd069
Add dataset check in start and end of build_dataset
illian01 Apr 16, 2024
8d7d823
Fix missed parameter
illian01 Apr 16, 2024
e9a9384
Checkout dataset length
illian01 Apr 16, 2024
ef28560
logger print before check
illian01 Apr 16, 2024
96ba21b
Fix info to warning
illian01 Apr 16, 2024
c80d6b9
Check path in dataset_mode_check
illian01 Apr 16, 2024
07d9b29
Rename dataset_mode_check to dataset_path_check
illian01 Apr 16, 2024
0745c17
Ruff fix
illian01 Apr 16, 2024
70920d6
Update CHANGELOG.md
illian01 Apr 16, 2024
c34875f
Merge pull request #417 from Nota-NetsPresso/253-dataset-validator
illian01 Apr 17, 2024
eb3e312
[hotfix] dataset_path_check is only for local dataset
illian01 Apr 17, 2024
82a4032
Merge branch 'dev' of https://github.com/Nota-NetsPresso/netspresso-t…
illian01 Apr 17, 2024
d0c2a48
Update CHANGELOG.md
illian01 Apr 17, 2024
5261867
Merge pull request #419 from Nota-NetsPresso/253-dataset-validator
illian01 Apr 17, 2024
9d17b74
Call save_summary at every end of epochs
illian01 Apr 17, 2024
846876f
Update CHANGELOG.md
illian01 Apr 17, 2024
48217e8
Merge pull request #420 from Nota-NetsPresso/403-training-summary-per…
illian01 Apr 17, 2024
e61c62e
Add cifar100 auto download code
illian01 Apr 18, 2024
8b9e98b
Add imagenet1k extracting and reformatting code
illian01 Apr 18, 2024
a9225d5
Fix path error
illian01 Apr 18, 2024
ddfce9a
refactor: postprocessors/register.py -> registry.py
aychun Apr 19, 2024
2d93095
Fix errors
illian01 Apr 19, 2024
25fa792
Update CHANGELOG.md
illian01 Apr 19, 2024
e405599
Merge pull request #424 from aychun/423-registry-file-name
illian01 Apr 19, 2024
69a59a1
Merge branch 'dev' of https://github.com/Nota-NetsPresso/netspresso-t…
illian01 Apr 19, 2024
4212e81
Change download path
illian01 Apr 19, 2024
3ad5ff9
Add coco2017 auto download code
illian01 Apr 19, 2024
8e53971
Add voc2012 auto download code
illian01 Apr 21, 2024
8de8801
Name typo...
illian01 Apr 21, 2024
86cf173
Add open_dataset_tool README
illian01 Apr 21, 2024
df9e47c
Remove extracted dirs and change label dir
illian01 Apr 21, 2024
02a5f0a
Update cifar100.yaml
illian01 Apr 21, 2024
d92cd79
Add id_mapping save
illian01 Apr 21, 2024
57d95df
Update scipy
illian01 Apr 21, 2024
3c82ddd
Fix typo
illian01 Apr 21, 2024
f00296f
Update imagenet1k.yaml
illian01 Apr 21, 2024
1cc384c
Change label directory
illian01 Apr 21, 2024
49b1e15
Fix typo
illian01 Apr 21, 2024
ab2c0b9
Update voc12.yaml
illian01 Apr 21, 2024
7243823
Update coco2017.yaml
illian01 Apr 21, 2024
ae64939
Remove word
illian01 Apr 21, 2024
9427ca0
Sort out data configs
illian01 Apr 21, 2024
c0ea3b5
Fix test directory check line
illian01 Apr 22, 2024
70dbe9b
Update CHANGELOG.md
illian01 Apr 22, 2024
7d4c0ae
Merge pull request #428 from Nota-NetsPresso/427-path-check-bug
illian01 Apr 22, 2024
6dd90df
Move tools readme to docs
illian01 Apr 22, 2024
726e8dd
Update docs
illian01 Apr 22, 2024
88a3a14
Update README.md
illian01 Apr 22, 2024
d15e308
Normalize box
illian01 Apr 22, 2024
0ae649b
Add huggingface cifar100.yaml
illian01 Apr 22, 2024
7349e75
Update CHANGELOG.md
illian01 Apr 22, 2024
a26dc9d
Merge branch 'dev' of https://github.com/Nota-NetsPresso/netspresso-t…
illian01 Apr 22, 2024
af4f31d
Merge pull request #430 from Nota-NetsPresso/404-dataset-converter
illian01 Apr 22, 2024
de7ff19
Minor docs update
illian01 Apr 23, 2024
274f3d5
Merge pull request #431 from Nota-NetsPresso/404-dataset-converter
illian01 Apr 23, 2024
a78e7c5
Update classification load_id_mapping
illian01 Apr 23, 2024
6b4dfcf
Update detection load_id_mapping
illian01 Apr 23, 2024
ce39e1f
Fix segmentation load_class_map return
illian01 Apr 25, 2024
f3035c0
Add TODO for pose_estimation
illian01 Apr 25, 2024
b167d81
Save id_mapping.txt
illian01 Apr 25, 2024
ceb0130
Update config
illian01 Apr 25, 2024
47c775e
Ruff fix
illian01 Apr 25, 2024
0f87d02
Update CHANGELOG.md
illian01 Apr 25, 2024
2819b31
Merge pull request #432 from Nota-NetsPresso/426-id-mapping-file
illian01 Apr 25, 2024
c9be652
Set exist_ok
illian01 Apr 30, 2024
e03843e
Add id_mapping save
illian01 Apr 30, 2024
fc81ece
Change error
illian01 Apr 30, 2024
f60a1fc
Add label image mode and change id_mapping to json
illian01 Apr 30, 2024
8526536
Update voc2012 configs
illian01 Apr 30, 2024
d586332
Fix segmentation load_id_mapping
illian01 Apr 30, 2024
e0e8d96
Change id_mapping to json
illian01 Apr 30, 2024
6e0c136
Add wflw dataset tool
illian01 May 2, 2024
c9537f9
Fix pose estimation load_id_mapping
illian01 May 2, 2024
270b1fe
Add install command in Dockerfile.
cbpark-nota May 2, 2024
8246254
Fix swap value error
illian01 May 2, 2024
f21c95d
Update wflw config
illian01 May 2, 2024
bb684d2
Update docs
illian01 May 2, 2024
5560997
Ruff fix
illian01 May 2, 2024
9e1d657
Update CHANGELOG.md
illian01 May 2, 2024
fc0f291
Merge pull request #434 from cbpark-nota/dev
illian01 May 2, 2024
60ef409
Merge branch 'dev' of https://github.com/Nota-NetsPresso/netspresso-t…
illian01 May 2, 2024
c4b8b09
Update CHANGELOG.md
illian01 May 2, 2024
0c85dbe
Update docs to simple use.
cbpark-nota May 2, 2024
1f7d29a
Merge pull request #435 from Nota-NetsPresso/426-id-mapping-file
illian01 May 2, 2024
81802fb
Update configs
illian01 May 2, 2024
9282e5c
Fix missed fields
illian01 May 2, 2024
63a44a4
Update CHANGELOG.md
illian01 May 2, 2024
7fb507c
Merge pull request #438 from Nota-NetsPresso/418-update-configurations
illian01 May 3, 2024
0a496d6
Update CHANGELOG.md
illian01 May 3, 2024
ab9cdde
Merge branch 'dev' of https://github.com/Nota-NetsPresso/netspresso-t…
illian01 May 3, 2024
39739a2
Merge pull request #437 from cbpark-nota/dev
illian01 May 3, 2024
4c2dd56
Update pr template
illian01 May 3, 2024
f1b7157
Merge pull request #439 from Nota-NetsPresso/update-pr-template
illian01 May 3, 2024
51e5564
Minor typos and print
illian01 May 3, 2024
e2f57e1
Merge pull request #440 from Nota-NetsPresso/minor-fix
illian01 May 3, 2024
86880fe
v0.2.1 release commit
illian01 May 3, 2024
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
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ For example,

```
- Added a new feature by `@myusername` in [PR 2023](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/2023)
```
```

Please enable **Allow edits and access to secrets by maintainers** so that our maintainers can update the `CHANGELOG.md`.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,30 @@ No changes to highlight.

No changes to highlight.

# v0.2.1

## New Features:

- Add dataset validation step and refactoring data modules by `@illian01` in [PR 417](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/417), [PR 419](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/419)
- Add various dataset examples including automatic open dataset format converter by `@illian01` in [PR 430](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/430)
- Allow using text file path for the `id_mapping` field by `@illian01` in [PR 432](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/432), [PR 435](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/435)

## Bug Fixes:

- Fix test directory check line by `@illian01` in [PR 428](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/428)
- Fix Dockerfile installation commandline `@cbpark-nota` in [PR 434](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/434)

## Breaking Changes:

No changes to highlight.

## Other Changes:

- Save training summary at every end of epochs by `@illian01` in [PR 420](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/420)
- Refacotring: rename postprocessors/register.py to registry.py by `@aychun` in [PR 424](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/424)
- Add example configuration set by `@illian01` in [PR 438](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/438)
- Documentation: fix simple use config file path by `@cbpark-nota` in [PR 437](https://github.com/Nota-NetsPresso/netspresso-trainer/pull/437)

# v0.2.0

## New Features:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ COPY . /home/appuser/netspresso-trainer

RUN pip install -r requirements.txt && rm -rf /root/.cache/pip
RUN pip install -r requirements-optional.txt && rm -rf /root/.cache/pip
RUN python3 -m pip install -e .
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,37 @@ Please refer to [`scripts/example_train.sh`](./scripts/example_train.sh).

NetsPresso Trainer is compatible with [NetsPresso](https://netspresso.ai/) service. We provide NetsPresso Trainer tutorial that contains whole procedure from model train to model compression and benchmark. Please refer to our [colab tutorial](https://colab.research.google.com/drive/1RBKMCPEa4x-4X31zqzTS8WgQI9TQt3e-?usp=sharing).

## Dataset preparation (Local)

NetsPresso Trainer is designed to accommodate a variety of tasks, each requiring different dataset formats. You can find the specific dataset formats for each task in our [documentation](https://nota-netspresso.github.io/netspresso-trainer/components/data/).

If you are interested in utilizing open datasets, you can use them by following the [instructions](https://nota-netspresso.github.io/netspresso-trainer/getting_started/dataset_preparation/local/#open-datasets).

### Image classification

- [CIFAR100](https://github.com/Nota-NetsPresso/netspresso-trainer/blob/dev/tools/open_dataset_tool/cifar100.py)
- [ImageNet1K](https://github.com/Nota-NetsPresso/netspresso-trainer/blob/dev/tools/open_dataset_tool/imagenet1k.py)

### Semantic segmentation

- [PascalVOC 2012](https://github.com/Nota-NetsPresso/netspresso-trainer/blob/dev/tools/open_dataset_tool/voc2012_seg.py)

### Object detection

- [COCO 2017](https://github.com/Nota-NetsPresso/netspresso-trainer/blob/dev/tools/open_dataset_tool/coco2017.py)

### Pose estimation

- [WFLW](https://github.com/Nota-NetsPresso/netspresso-trainer/blob/dev/tools/open_dataset_tool/wflw.py)

## Dataset preparation (Huggingface)

NetsPresso Trainer is also compatible with huggingface dataset. To use datasets of huggingface, please check [instructions in our documentations](https://nota-netspresso.github.io/netspresso-trainer/getting_started/dataset_preparation/huggingface/). This enables to utilize a wide range of pre-built datasets which are beneficial for various training scenarios.

## Pretrained weights

Please refer to our [official documentation](https://nota-netspresso.github.io/netspresso-trainer/) for pretrained weights supported by NetsPresso Trainer.

## Tensorboard

We provide basic tensorboard to track your training status. Run the tensorboard with the following command:
Expand All @@ -109,9 +140,4 @@ tensorboard --logdir ./outputs --port 50001 --bind_all
```

where `PORT` for tensorboard is 50001.
Note that the default directory of saving result will be `./outputs` directory.


## Pretrained weights

Please refer to our [official documentation](https://nota-netspresso.github.io/netspresso-trainer/) for pretrained weights supported by NetsPresso Trainer.
Note that the default directory of saving result will be `./outputs` directory.
1 change: 0 additions & 1 deletion config/augmentation/pose_estimation.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
augmentation:
img_size: &img_size 256
train:
-
name: randomhorizontalflip
Expand Down
1 change: 0 additions & 1 deletion config/augmentation/segmentation.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
augmentation:
img_size: &img_size 512
train:
-
name: randomresizedcrop
Expand Down
31 changes: 1 addition & 30 deletions config/augmentation/template/common.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
augmentation:
train:
-
name: randomresizedcrop
size: ~
sclale: ~
ratio: ~
interpolation: bilinear
-
name: randomhorizontalflip
p: ~
-
name: randomverticalflip
p: ~
-
name: colorjitter
brightness: ~
contrast: ~
saturation: ~
hue: ~
p: ~
-
name: resize
size: ~
interpolation: ~
max_size: ~
-
name: pad
padding: ~
fill: ~
padding_mode: ~
train: ~
inference: ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
augmentation:
train:
-
name: randomresizedcrop
size: 256
scale: [0.08, 1.0]
ratio: [0.75, 1.33]
interpolation: bilinear
-
name: randomhorizontalflip
p: 0.5
inference:
-
name: resize
size: [256, 256]
interpolation: bilinear
max_size: ~
resize_criteria: ~
-
name: centercrop
size: 224
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
data:
name: IMAGENET1K
task: classification
format: local # local, huggingface
path:
root: ./data/imagenet1k # dataset root
train:
image: images/train # directory for training images
label: labels/imagenet_train.csv # directory for training labels or csv file
valid:
image: images/valid # directory for valid images
label: labels/imagenet_valid.csv # directory for valid labels or csv file
test:
image: ~
label: ~
id_mapping: id_mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
environment:
seed: 1
num_workers: 4
gpus: 0, 1, 2, 3, 4, 5, 6, 7
batch_size: 32 # Batch size per gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
logging:
project_id: ~
output_dir: ./outputs
tensorboard: true
image: true
stdout: true
save_optimizer_state: true
onnx_input_size: [224, 224]
validation_epoch: &validation_epoch 5
save_checkpoint_epoch: *validation_epoch # Multiplier of `validation_epoch`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
model:
task: classification
name: resnet18
checkpoint:
use_pretrained: False
load_head: False
path: ~
fx_model_path: ~
optimizer_path: ~
freeze_backbone: False
architecture:
full: ~ # auto
backbone:
name: resnet
params:
block_type: basicblock
norm_type: batch_norm
stage_params:
-
channels: 64
num_blocks: 2
-
channels: 128
num_blocks: 2
replace_stride_with_dilation: False
-
channels: 256
num_blocks: 2
replace_stride_with_dilation: False
-
channels: 512
num_blocks: 2
replace_stride_with_dilation: False
head:
name: fc
params:
num_layers: 1
intermediate_channels: ~
act_type: ~
dropout_prob: 0.
losses:
- criterion: cross_entropy
label_smoothing: 0.
weight: ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
training:
epochs: 90
mixed_precision: False
ema: ~
optimizer:
name: sgd
lr: 0.1
momentum: 0.9
weight_decay: 0.0001
nesterov: False
scheduler:
name: step
iters_per_phase: 30
gamma: 0.1
end_epoch: 90
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
augmentation:
train:
-
name: randomresizedcrop
size: 256
scale: [0.08, 1.0]
ratio: [0.75, 1.33]
interpolation: bilinear
-
name: randomhorizontalflip
p: 0.5
inference:
-
name: resize
size: [256, 256]
interpolation: bilinear
max_size: ~
resize_criteria: ~
-
name: centercrop
size: 224
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
data:
name: IMAGENET1K
task: classification
format: local # local, huggingface
path:
root: ./data/imagenet1k # dataset root
train:
image: images/train # directory for training images
label: labels/imagenet_train.csv # directory for training labels or csv file
valid:
image: images/valid # directory for valid images
label: labels/imagenet_valid.csv # directory for valid labels or csv file
test:
image: ~
label: ~
id_mapping: id_mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
environment:
seed: 1
num_workers: 4
gpus: 0, 1, 2, 3, 4, 5, 6, 7
batch_size: 32 # Batch size per gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
logging:
project_id: ~
output_dir: ./outputs
tensorboard: true
image: true
stdout: true
save_optimizer_state: true
onnx_input_size: [224, 224]
validation_epoch: &validation_epoch 5
save_checkpoint_epoch: *validation_epoch # Multiplier of `validation_epoch`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
model:
task: classification
name: resnet34
checkpoint:
use_pretrained: False
load_head: False
path: ~
fx_model_path: ~
optimizer_path: ~
freeze_backbone: False
architecture:
full: ~ # auto
backbone:
name: resnet
params:
block_type: basicblock
norm_type: batch_norm
stage_params:
-
channels: 64
num_blocks: 3
-
channels: 128
num_blocks: 4
replace_stride_with_dilation: False
-
channels: 256
num_blocks: 6
replace_stride_with_dilation: False
-
channels: 512
num_blocks: 3
replace_stride_with_dilation: False
head:
name: fc
params:
num_layers: 1
intermediate_channels: ~
act_type: ~
dropout_prob: 0.
losses:
- criterion: cross_entropy
label_smoothing: 0.
weight: ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
training:
epochs: 90
mixed_precision: False
ema: ~
optimizer:
name: sgd
lr: 0.1
momentum: 0.9
weight_decay: 0.0001
nesterov: False
scheduler:
name: step
iters_per_phase: 30
gamma: 0.1
end_epoch: 90
Loading
Loading