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

Bugfix for explore cli test to get datasetitem through path #1092

Merged
merged 20 commits into from
Jul 18, 2023

Conversation

sooahleex
Copy link
Contributor

@sooahleex sooahleex commented Jul 12, 2023

Summary

  • Due to train_path not matched with dataset._source_path, query is considered as string input, not coverted to Datasetitem or could not bring the proper Datasetitem which is matched with path through dataset.get_datasetitem_by_path(args.query).
  • Match train_path of CLI path as `project/source-1/images/train/1.jpg'.

How to test

  • I fixed the path in integration test.

Checklist

  • I have added unit tests to cover my changes.​
  • I have added integration tests to cover my changes.​
  • I have added the description of my changes into CHANGELOG.​
  • I have updated the documentation accordingly

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below).
# Copyright (C) 2023 Intel Corporation
#
# SPDX-License-Identifier: MIT

@yunchu yunchu added this to the 1.4.0 milestone Jul 12, 2023
@sooahleex sooahleex marked this pull request as ready for review July 13, 2023 02:23
@sooahleex sooahleex requested review from a team as code owners July 13, 2023 02:23
@sooahleex sooahleex requested review from vinnamkim and removed request for a team July 13, 2023 02:23
Copy link
Contributor

@vinnamkim vinnamkim left a comment

Choose a reason for hiding this comment

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

I recommend you to break the query explicitly into two cases:

  1. DatasetItem id (--query-item-id)
  2. Arbitrary image file path (not constrained to the project or dataset) (--query-img-path)

@sooahleex sooahleex marked this pull request as draft July 17, 2023 02:31
@sooahleex sooahleex marked this pull request as ready for review July 17, 2023 07:05
Comment on lines 177 to 186
def match_query_subset(query_id, dataset):
subset_names = list(dataset.subsets().keys())
for subset_name in subset_names:
try:
query_datasetitem = dataset.get(query_id, subset_name)
except Exception:
continue
if query_datasetitem:
break
return query_datasetitem
Copy link
Contributor

@vinnamkim vinnamkim Jul 17, 2023

Choose a reason for hiding this comment

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

Please add subset = None argument to this function and CLI argument parser. Then, iterate over subsets only if subset == None. In addition, I think this code should have a problem if there is no item for the given query_id. You need to raise an appropriate error in this case.

Copy link
Contributor

@vinnamkim vinnamkim left a comment

Choose a reason for hiding this comment

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

LGTM.

@sooahleex sooahleex merged commit 687eaa0 into openvinotoolkit:releases/1.4.0 Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants