Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -218,7 +218,7 @@ app.prepare(ctx_id=-1, det_size=(IMAGE_SHAPE, IMAGE_SHAPE)) # Use ctx_id=-1 if
|
|
218 |
def prod_function(app, prod_path, webcam_path):
|
219 |
webcam_img = Image.open(webcam_path)
|
220 |
np_webcam = np.array(webcam_img) # Convert to NumPy array
|
221 |
-
cv2_webcam = cv2.cvtColor(
|
222 |
|
223 |
webcam_emb = app.get(cv2_webcam, max_num=1)
|
224 |
webcam_emb = webcam_emb[0].embedding
|
|
|
218 |
def prod_function(app, prod_path, webcam_path):
|
219 |
webcam_img = Image.open(webcam_path)
|
220 |
np_webcam = np.array(webcam_img) # Convert to NumPy array
|
221 |
+
cv2_webcam = cv2.cvtColor(np_webcam, cv2.COLOR_RGB2BGR) # Convert RGB (PIL) to BGR (OpenCV)
|
222 |
|
223 |
webcam_emb = app.get(cv2_webcam, max_num=1)
|
224 |
webcam_emb = webcam_emb[0].embedding
|