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

Fix LetterResize bug with imrescale api #105

Merged
merged 10 commits into from
Sep 29, 2022

Conversation

Nioolek
Copy link
Collaborator

@Nioolek Nioolek commented Sep 29, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

·mmcv.imrescale· is used for keeping ratio resize. It may result in unequal input and output shape.
I changed mmcv.imrescale to mmcv.imresize. And optimize the code in transform.py.

image
image

Modification

Fix:
transform.py

dataset: COCO

Now, the LetterResize is used in test. So, we need to verify the test mAP results before and after the modification.
Use pretrained model yolov5s to test:
mAP results in README.md:
f8e3c0384d3851fc8ddd025b35be158

After:

 Average Precision  (AP) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.377
 Average Precision  (AP) @[ IoU=0.50      | area=   all | maxDets=100 ] = 0.571
 Average Precision  (AP) @[ IoU=0.75      | area=   all | maxDets=100 ] = 0.410
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.217
 Average Precision  (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.425
 Average Precision  (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.488
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=  1 ] = 0.310
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets= 10 ] = 0.516
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=   all | maxDets=100 ] = 0.572
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.384
 Average Recall     (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.629
 Average Recall     (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.720

PeterH0323 and others added 6 commits September 22, 2022 11:28
* [Feature] Make docker image smaller

* Improve doc

* Improve doc

* Improve doc

* Improve doc
* Use 'Compose' directly

Use 'Compose' directly

* avoids some unnecessary calculations

avoids some unnecessary calculations.

* remove whitespace

remove whitespace
@PeterH0323
Copy link
Collaborator

Hi @Nioolek

I saw that you are using train to eval it . But when we using coco dataset to train, the LetterResize is not been use, we need to use pre-trained model to run test.py to compare mAP both before and after refactor

@hhaAndroid hhaAndroid changed the title Dev fix resize Fix LetterResize bug with imrescale api Sep 29, 2022
@Nioolek
Copy link
Collaborator Author

Nioolek commented Sep 29, 2022

Hi @Nioolek

I saw that you are using train to eval it . But when we using coco dataset to train, the LetterResize is not been use, we need to use pre-trained model to run test.py to compare mAP both before and after refactor

I used the method you mentioned, and updated the doc.

@hhaAndroid hhaAndroid merged commit fa9df21 into open-mmlab:dev Sep 29, 2022
hhaAndroid pushed a commit that referenced this pull request Sep 29, 2022
* [Feature] Make docker image smaller (#67)

* [Feature] Make docker image smaller


* Improve doc

* Use Compose directly in BaseMixImageTransform (#71)

* Use 'Compose' directly

Use 'Compose' directly

* avoids some unnecessary calculations

avoids some unnecessary calculations.

* remove whitespace

remove whitespace

* fix resize bug

* fix resize bug

* fix resize bug

* fix

* fix resize bug

* add test letterresize without batchshape

* fix resize bug

Co-authored-by: HinGwenWoong <peterhuang0323@qq.com>
Co-authored-by: jason_w <wongzheng@126.com>
@Nioolek Nioolek deleted the dev_fix_resize branch October 19, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants