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

Add modelAPI related stuff #1219

Conversation

ashwinvaidya17
Copy link
Collaborator

Description

  • Adds support for the current version of modelAPI. This way the users can export the models from Anomalib and use it with cpp/python modelAPI wrappers. These are similar to the changes in OTX

tmp_xml_path = Path(Path(xml_file).parent) / "tmp.xml"
serialize(model, str(tmp_xml_path))
tmp_xml_path.rename(xml_file)
Path(str(tmp_xml_path.parent / tmp_xml_path.stem) + ".bin").unlink()
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have have something like this

Suggested change
Path(str(tmp_xml_path.parent / tmp_xml_path.stem) + ".bin").unlink()
tmp_xml_path.with_suffix(".bin").unlink()

Path(str(tmp_xml_path.parent / tmp_xml_path.stem) + ".bin").unlink()


def _serialize_list(arr):
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be possible to annotate the variable and add docstring please

src/anomalib/deploy/export.py Show resolved Hide resolved
@github-actions github-actions bot added the Tests label Jul 28, 2023
Comment on lines 224 to 227
tmp_xml_path = Path(Path(xml_file).parent) / "tmp.xml"
serialize(model, str(tmp_xml_path))
tmp_xml_path.rename(xml_file)
tmp_xml_path.with_suffix(".bin").unlink()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be good to add a comment explaining this section

Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

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

thanks, just a single line of change

@samet-akcay samet-akcay merged commit 0b5d969 into openvinotoolkit:main Aug 21, 2023
@ashwinvaidya17 ashwinvaidya17 mentioned this pull request Aug 28, 2023
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.

3 participants