[GSoC] Added TF and PyTorch classification conversion cases#17604
[GSoC] Added TF and PyTorch classification conversion cases#17604alalek merged 8 commits intoopencv:masterfrom
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
alalek
left a comment
There was a problem hiding this comment.
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? |
alalek
left a comment
There was a problem hiding this comment.
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) |
| 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.
The same values are in default_preprocess_config.py. Let's reuse the constants.
|
@LupusSanctus Friendly reminder. |
968723b to
1cb5054
Compare
…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.