Spaces:
Sleeping
Sleeping
Commit
·
9d8f8c8
1
Parent(s):
b33e657
change inference path
Browse files
app.py
CHANGED
@@ -117,7 +117,7 @@ def process_image(img_path):
|
|
117 |
image_path = image_path.replace(" ", "_")
|
118 |
|
119 |
# Join to directory path
|
120 |
-
inf_image = os.path.join("inference",
|
121 |
|
122 |
# Use repo for inference
|
123 |
inp.save(inf_image, exif=exif)
|
@@ -158,6 +158,7 @@ def process_image(img_path):
|
|
158 |
|
159 |
return np_image
|
160 |
|
|
|
161 |
# Category to name mapping
|
162 |
with open("cat_to_name.json", "r") as f:
|
163 |
cat_to_name = json.load(f)
|
@@ -226,6 +227,7 @@ def predict(image_path, model=model, category_names=cat_to_name, topk=5):
|
|
226 |
|
227 |
return fig
|
228 |
|
|
|
229 |
# Gradio Interface
|
230 |
gr.Interface(
|
231 |
predict,
|
|
|
117 |
image_path = image_path.replace(" ", "_")
|
118 |
|
119 |
# Join to directory path
|
120 |
+
inf_image = os.path.join("inference", image_path)
|
121 |
|
122 |
# Use repo for inference
|
123 |
inp.save(inf_image, exif=exif)
|
|
|
158 |
|
159 |
return np_image
|
160 |
|
161 |
+
|
162 |
# Category to name mapping
|
163 |
with open("cat_to_name.json", "r") as f:
|
164 |
cat_to_name = json.load(f)
|
|
|
227 |
|
228 |
return fig
|
229 |
|
230 |
+
|
231 |
# Gradio Interface
|
232 |
gr.Interface(
|
233 |
predict,
|