EngAbod commited on
Commit
2048532
·
1 Parent(s): ae45eb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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
- # 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,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
- frm3 = create_blake_image(frm)
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