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

feat: Added checkpoint for obj_detection #713

Merged
merged 4 commits into from
Dec 17, 2021
Merged

feat: Added checkpoint for obj_detection #713

merged 4 commits into from
Dec 17, 2021

Conversation

SiddhantBahuguna
Copy link
Contributor

This PR adds a checkpoint for artefact detection.
Any feedback is welcome:)

@SiddhantBahuguna SiddhantBahuguna added type: enhancement Improvement module: models Related to doctr.models topic: object detection Related to the task of object detection labels Dec 14, 2021
@SiddhantBahuguna SiddhantBahuguna self-assigned this Dec 14, 2021
@fg-mindee fg-mindee added this to the 0.5.0 milestone Dec 14, 2021
Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Would you mind modifying the unittest https://github.com/mindee/doctr/blob/main/tests/pytorch/test_models_obj_detection_pt.py
with:

  • reducing the input size to (512, 512) to ease the RAM
  • before line 15, recreate the model by passing pretrained=True to ensure the checkpoint can be downloaded

@SiddhantBahuguna
Copy link
Contributor Author

Thanks!

Would you mind modifying the unittest https://github.com/mindee/doctr/blob/main/tests/pytorch/test_models_obj_detection_pt.py with:

* reducing the input size to (512, 512) to ease the RAM

* before line 15, recreate the model by passing `pretrained=True` to ensure the checkpoint can be downloaded

Thanks. I have made the changes .

@codecov
Copy link

codecov bot commented Dec 14, 2021

Codecov Report

Merging #713 (60dd114) into main (c32c1ed) will increase coverage by 0.08%.
The diff coverage is n/a.

❗ Current head 60dd114 differs from pull request most recent head f20e299. Consider uploading reports for the commit f20e299 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main     #713      +/-   ##
==========================================
+ Coverage   96.23%   96.32%   +0.08%     
==========================================
  Files         125      125              
  Lines        4707     4707              
==========================================
+ Hits         4530     4534       +4     
+ Misses        177      173       -4     
Flag Coverage Δ
unittests 96.32% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
doctr/models/obj_detection/faster_rcnn/pytorch.py 87.50% <ø> (-6.25%) ⬇️
doctr/models/builder.py 99.12% <0.00%> (+2.63%) ⬆️
doctr/models/recognition/predictor/pytorch.py 96.96% <0.00%> (+6.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c32c1ed...f20e299. Read the comment docs.

Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last suggestion to check both cases (especially for faster, pretrained=True does change a lot the initialization of the model)

tests/pytorch/test_models_obj_detection_pt.py Outdated Show resolved Hide resolved
tests/pytorch/test_models_obj_detection_pt.py Outdated Show resolved Hide resolved
tests/pytorch/test_models_obj_detection_pt.py Outdated Show resolved Hide resolved
tests/pytorch/test_models_obj_detection_pt.py Outdated Show resolved Hide resolved
@fg-mindee fg-mindee added the ext: tests Related to tests folder label Dec 15, 2021
@SiddhantBahuguna
Copy link
Contributor Author

Last suggestion to check both cases (especially for faster, pretrained=True does change a lot the initialization of the model)

Thanks for all the suggestions :) Implemented them all

@SiddhantBahuguna
Copy link
Contributor Author

I think it had passed the unittest for object detection. It should not be a problem right?
A checkpoint was restored (e.g. tf.train.Checkpoint.restore or tf.keras.Model.load_weights) but not all checkpointed values were used. See above for specific issues. Use expect_partial() on the load status object, e.g. tf.train.Checkpoint.restore(...).expect_partial(), to silence these warnings, or use assert_consumed() to make the check explicit. See https://www.tensorflow.org/guide/checkpoint#loading_mechanics for details. Error: Process completed with exit code 1.

fg-mindee
fg-mindee previously approved these changes Dec 16, 2021
Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks!

Copy link
Contributor

@fg-mindee fg-mindee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, the CI is having timeouts on datasets unittests, but that will be fixed by another PR quite soon anyway!

@SiddhantBahuguna
Copy link
Contributor Author

All good, the CI is having timeouts on datasets unittests, but that will be fixed by another PR quite soon anyway!

Thanks for the information :)

@fg-mindee fg-mindee merged commit 60c86eb into main Dec 17, 2021
@fg-mindee fg-mindee deleted the art_checkpoint branch December 17, 2021 16:29
@fg-mindee fg-mindee added type: new feature New feature framework: pytorch Related to PyTorch backend and removed type: enhancement Improvement labels Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ext: tests Related to tests folder framework: pytorch Related to PyTorch backend module: models Related to doctr.models topic: object detection Related to the task of object detection type: new feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants