Kaushik066 commited on
Commit
4c8602a
·
verified ·
1 Parent(s): d96c5c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -217,7 +217,10 @@ app.prepare(ctx_id=-1, det_size=(IMAGE_SHAPE, IMAGE_SHAPE)) # Use ctx_id=-1 if
217
  # Define the ML model - Evaluation function
218
  def prod_function(app, prod_path, webcam_path):
219
  webcam_img = Image.open(webcam_path)
220
- webcam_emb = app.get(webcam_img, max_num=1)
 
 
 
221
  webcam_emb = webcam_emb[0].embedding
222
 
223
  similarity_score = []
 
217
  # Define the ML model - Evaluation function
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_image, 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
225
 
226
  similarity_score = []