Spaces:
Runtime error
Runtime error
add frame shape fix
Browse files
app.py
CHANGED
@@ -46,7 +46,6 @@ def execute_text_recognition_tflite( boxes, frame, interpreter, input_details, o
|
|
46 |
|
47 |
def greet(image):
|
48 |
resized = cv2.resize(image, (320,320), interpolation=cv2.INTER_AREA)
|
49 |
-
demo_frame = cv2.resize(image, (680,480), interpolation=cv2.INTER_AREA)
|
50 |
input_data = resized.astype(np.float32) # Set as 3D RGB float array
|
51 |
input_data /= 255. # Normalize
|
52 |
input_data = np.expand_dims(input_data, axis=0) # Batch dimension (wrap in 4D)
|
@@ -68,7 +67,7 @@ def greet(image):
|
|
68 |
recog_interpreter, recog_input_details, recog_output_details,
|
69 |
)
|
70 |
return text
|
71 |
-
image = gr.inputs.Image(shape=(
|
72 |
|
73 |
iface = gr.Interface(fn=greet, inputs=image, outputs="text")
|
74 |
iface.launch()
|
|
|
46 |
|
47 |
def greet(image):
|
48 |
resized = cv2.resize(image, (320,320), interpolation=cv2.INTER_AREA)
|
|
|
49 |
input_data = resized.astype(np.float32) # Set as 3D RGB float array
|
50 |
input_data /= 255. # Normalize
|
51 |
input_data = np.expand_dims(input_data, axis=0) # Batch dimension (wrap in 4D)
|
|
|
67 |
recog_interpreter, recog_input_details, recog_output_details,
|
68 |
)
|
69 |
return text
|
70 |
+
image = gr.inputs.Image(shape=(1920,1080))
|
71 |
|
72 |
iface = gr.Interface(fn=greet, inputs=image, outputs="text")
|
73 |
iface.launch()
|