Spaces:
Runtime error
Runtime error
input details corrected
Browse files- extractor.py +3 -3
extractor.py
CHANGED
|
@@ -15,8 +15,8 @@ def get_card_xy(model_path, image_path):
|
|
| 15 |
st.write(f"{input_details}")
|
| 16 |
|
| 17 |
# Obtain the height and width of the corresponding image from the input tensor
|
| 18 |
-
image_height = input_details[0]['shape'][
|
| 19 |
-
image_width = input_details[0]['shape'][
|
| 20 |
|
| 21 |
# Image Preparation
|
| 22 |
# image_name = 'car.jpg'
|
|
@@ -28,7 +28,7 @@ def get_card_xy(model_path, image_path):
|
|
| 28 |
image_np = image_np[np.newaxis, :]
|
| 29 |
|
| 30 |
# inference
|
| 31 |
-
interpreter.set_tensor(input_details[0]['index'], image_np)
|
| 32 |
interpreter.invoke()
|
| 33 |
|
| 34 |
# Obtaining output results
|
|
|
|
| 15 |
st.write(f"{input_details}")
|
| 16 |
|
| 17 |
# Obtain the height and width of the corresponding image from the input tensor
|
| 18 |
+
image_height = input_details[0]['shape'][2] # 640
|
| 19 |
+
image_width = input_details[0]['shape'][3] # 640
|
| 20 |
|
| 21 |
# Image Preparation
|
| 22 |
# image_name = 'car.jpg'
|
|
|
|
| 28 |
image_np = image_np[np.newaxis, :]
|
| 29 |
|
| 30 |
# inference
|
| 31 |
+
interpreter.set_tensor(input_details[0]['index']+1, image_np)
|
| 32 |
interpreter.invoke()
|
| 33 |
|
| 34 |
# Obtaining output results
|