Skip to content

[GSoC] Added TF and PyTorch segmentation conversion cases#17801

Merged
alalek merged 3 commits intoopencv:masterfrom
LupusSanctus:am/pytorch_tf_segm
Apr 1, 2021
Merged

[GSoC] Added TF and PyTorch segmentation conversion cases#17801
alalek merged 3 commits intoopencv:masterfrom
LupusSanctus:am/pytorch_tf_segm

Conversation

@LupusSanctus
Copy link
Copy Markdown

@LupusSanctus LupusSanctus commented Jul 10, 2020

GSoC project: "Write a tutorial about training a network in TF or PyTorch and then running it in OpenCV"

Part 1. Classification case
Part 2. Segmentation case:

  • TensorFlow DNN (FCN example) => DNN conversion => OpenCV Net object
  • PyTorch DNN (FCN example) => DNN conversion => OpenCV Net object
  • Evaluation

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

force_builders_only=Docs

@vpisarev vpisarev added the GSoC label Jul 19, 2020
@dkurt
Copy link
Copy Markdown
Member

dkurt commented Jul 20, 2020

It's not clear for me what this PR proposes. Can you summarize in the description?

MODEL_PATH_ROOT = os.path.join(DNN_LIB.lower() + "_conversion", "{}/models")


def make_dir(dir_to_create):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can replace the function with os.path.makedirs(dir_to_create, exist_ok=True)

plt.title(experiment_name, fontsize=15)
plt.legend()
plt.savefig(experiment_name.replace(" ", "_") + ".png", bbox_inches="tight")
pass
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pass is redundant here.

pass


# https://github.com/opencv/opencv/blob/9ba5581d176baf7c8fceb12b4dcef6c49c7a087d/modules/dnn/test/imagenet_cls_test_alexnet.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I propose to replace the URL to relative file name in OpenCV repository. The link points to particular commit, but the file changes time to time.

@LupusSanctus LupusSanctus changed the title WIP: Added TF and PyTorch segmentation conversion cases WIP: [GSoC] Added TF and PyTorch segmentation conversion cases Aug 31, 2020
@asmorkalov
Copy link
Copy Markdown
Contributor

@LupusSanctus Friendly reminder.

@asmorkalov
Copy link
Copy Markdown
Contributor

@LupusSanctus the first part has been merged. Please re-base the PR and fix CI-reported issues.

@LupusSanctus LupusSanctus changed the title WIP: [GSoC] Added TF and PyTorch segmentation conversion cases [GSoC] Added TF and PyTorch segmentation conversion cases Apr 1, 2021
@alalek alalek merged commit ad333e0 into opencv:master Apr 1, 2021
@alalek alalek mentioned this pull request Apr 9, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
[GSoC] Added TF and PyTorch segmentation conversion cases

* WIP: Added conversion of segmentation models

* Added tutorial mds

* remove unused
@ethanc8
Copy link
Copy Markdown

ethanc8 commented Jun 29, 2024

@LupusSanctus could you please provide the images linked to the tutorials and also the full self-contained segmentation code, especially the implementations of get_colored_mask and get_legend? It's hard to understand your tutorials when there are links to nonexistent images, the referenced sample code file doesn't share any code with the tutorial, and the tutorial doesn't provide the implementations of important functions required to see if the code has been actually working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants