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

SparseZoo V2 Compatibility #1233

Merged
merged 6 commits into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions tests/deepsparse/image_classification/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ def test_image_classification_pipeline_preprocessing(
ic_pipeline = Pipeline.create("image_classification", model_path=zoo_stub)
zoo_model = Model(zoo_stub)
data_originals_path = None
if zoo_model.sample_originals is not None:
if not zoo_model.sample_originals.files:
zoo_model.sample_originals.unzip()
data_originals_path = zoo_model.sample_originals.path
if zoo_model.sample_inputs is not None:
Copy link
Member

Choose a reason for hiding this comment

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

Do we not have sample_originals anymore?

Copy link
Member

Choose a reason for hiding this comment

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

Some models do not have originals.

if not zoo_model.sample_inputs.files:
zoo_model.sample_inputs.unzip()
data_originals_path = zoo_model.sample_inputs.path
for idx, sample in enumerate(load_numpy_list(data_originals_path)):
image_raw = list(sample.values())[0]
image_raw = list(sample.values())[0].astype(numpy.uint8)
image_raw = numpy.transpose(image_raw, axes=[1, 2, 0])
image_raw = Image.fromarray(image_raw)

preprocessed_image_pipeline = ic_pipeline.process_inputs(
Expand Down
Loading