Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -132,8 +132,8 @@ def spatial_pyramid(image, num_bins):
|
|
| 132 |
return feature_vector
|
| 133 |
def create_blake_image(input_image):
|
| 134 |
# Read the image from the BytesIO object
|
| 135 |
-
|
| 136 |
-
img = input_image
|
| 137 |
# Get the shape of the original image
|
| 138 |
height, width, _ = img.shape
|
| 139 |
|
|
@@ -324,8 +324,7 @@ class VideoProcessor:
|
|
| 324 |
cv2.putText(frm, text, (20, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 0))
|
| 325 |
else:
|
| 326 |
cv2.putText(frm, text, (20, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255))
|
| 327 |
-
|
| 328 |
-
frm = frm3.to_ndarray(format="bgr24")
|
| 329 |
return av.VideoFrame.from_ndarray(frm, format='bgr24')
|
| 330 |
# Inside your Streamlit app
|
| 331 |
|
|
|
|
| 132 |
return feature_vector
|
| 133 |
def create_blake_image(input_image):
|
| 134 |
# Read the image from the BytesIO object
|
| 135 |
+
img = cv2.imdecode(np.frombuffer(input_image.read(), np.uint8), -1)
|
| 136 |
+
# img = input_image
|
| 137 |
# Get the shape of the original image
|
| 138 |
height, width, _ = img.shape
|
| 139 |
|
|
|
|
| 324 |
cv2.putText(frm, text, (20, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 255, 0))
|
| 325 |
else:
|
| 326 |
cv2.putText(frm, text, (20, 50), cv2.FONT_HERSHEY_SIMPLEX, 2, (0, 0, 255))
|
| 327 |
+
frm = create_blake_image(frm)
|
|
|
|
| 328 |
return av.VideoFrame.from_ndarray(frm, format='bgr24')
|
| 329 |
# Inside your Streamlit app
|
| 330 |
|