Skip to content

Commit 8257ca9

Browse files
authored
Fix a bug where in image_classification pipelines, a model_dir was not being accepted properly (#1070)
1 parent 228751f commit 8257ca9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/deepsparse/image_classification/pipelines.py

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
Image classification pipeline
1717
"""
1818
import json
19+
from pathlib import Path
1920
from typing import Dict, List, Optional, Tuple, Type, Union
2021

2122
import numpy
@@ -135,6 +136,10 @@ class properties into an inference ready onnx file to be compiled by the
135136
:return: file path to the ONNX file for the engine to compile
136137
"""
137138

139+
model_path_: Path = Path(self.model_path)
140+
if model_path_.is_dir():
141+
return model_to_path(str(model_path_ / "model.onnx"))
142+
138143
return model_to_path(self.model_path)
139144

140145
def process_inputs(self, inputs: ImageClassificationInput) -> List[numpy.ndarray]:

0 commit comments

Comments
 (0)