CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
[GSoC] Added TF and PyTorch classification conversion cases #17604
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
[GSoC] Added TF and PyTorch classification conversion cases #17604
Conversation
b1747b0
to
1eba64f
Compare
samples/python/tutorial_code/dnn/dnn_conversion/common/accuracy_eval.py
Outdated
Show resolved
Hide resolved
samples/python/tutorial_code/dnn/dnn_conversion/common/accuracy_eval.py
Outdated
Show resolved
Hide resolved
samples/python/tutorial_code/dnn/dnn_conversion/common/accuracy_eval.py
Outdated
Show resolved
Hide resolved
samples/python/tutorial_code/dnn/dnn_conversion/common/accuracy_eval.py
Outdated
Show resolved
Hide resolved
samples/python/tutorial_code/dnn/dnn_conversion/common/accuracy_eval.py
Outdated
Show resolved
Hide resolved
samples/python/tutorial_code/dnn/dnn_conversion/requirements.txt
Outdated
Show resolved
Hide resolved
samples/python/tutorial_code/dnn/dnn_conversion/tf/classification/py_to_py_resnet50.py
Outdated
Show resolved
Hide resolved
dfd9c89
to
a772769
Compare
a772769
to
7e6cb9c
Compare
7e6cb9c
to
3907135
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to clarify licensing terms of used images.
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
Outdated
Show resolved
Hide resolved
e93ee9d
to
b4e36ea
Compare
There is conflict in
|
Please add bock with setup instructions. Let's expect that user already have python3 and pip installed. |
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_tutorial.md
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_tutorial.md
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_tutorial.md
Show resolved
Hide resolved
@LupusSanctus Sorry for confusion, please ignore the |
Please rebase commits to resolve merge conflicts. |
b4e36ea
to
968723b
Compare
@asmorkalov, setup instructions were added in tutorial's |
Is this PR in WIP status? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
Please take a look on minor comments below.
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/pytorch_cls_model_conversion_c_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
Outdated
Show resolved
Hide resolved
doc/tutorials/dnn/dnn_pytorch_tf_classification/tf_cls_model_conversion_tutorial.md
Outdated
Show resolved
Hide resolved
|
||
def get_args_parser(func_args): | ||
backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_HALIDE, cv.dnn.DNN_BACKEND_INFERENCE_ENGINE, | ||
cv.dnn.DNN_BACKEND_OPENCV) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CuDNN?
img = img.astype(np.float32) | ||
img *= BASE_IMG_SCALE_FACTOR | ||
img -= [0.485, 0.456, 0.406] | ||
img /= [0.229, 0.224, 0.225] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same values are in default_preprocess_config.py
. Let's reuse the constants.
@LupusSanctus Friendly reminder. |
968723b
to
1cb5054
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Thank you 👍
…utorial [GSoC] Added TF and PyTorch classification conversion cases * Added TF and PyTorch classification conversion cases * Modified structure, some processing scripts. Added evaluation pipeline * Minor structure change * Removed extra functions, minor structure change * Modified structure, code corrections * Updated classification code block, added classification tutorials * Added minor modifications of paths * Classification block corrections in accordance with comments
GSoC project: "Write a tutorial about training a network in TF or PyTorch and then running it in OpenCV"
Part 1. Classification case.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.