Kaushik066 commited on
Commit
3b9211b
·
verified ·
1 Parent(s): 0d6332b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -200,14 +200,18 @@ if picture is not None:
200
  ## Create DataLoader for Webcam Image
201
  webcam_ds = dataset_prod_obj.create_dataset(picture, webcam=True)
202
  webcam_dl = DataLoader(webcam_ds, batch_size=BATCH_SIZE)
 
 
 
 
203
 
204
  ## Run the predictions
205
- prediction = prod_function(model_pretrained, prod_dl, webcam_dl)
206
- predictions = torch.cat(prediction, 0).to(device)
207
- match_idx = torch.argmin(predictions)
208
 
209
  ## Display the results
210
- if predictions[match_idx] <= 0.3:
211
- st.write('Welcome: ',image_paths[match_idx].split('/')[-1].split('.')[0])
212
- else:
213
- st.write("Match not found")
 
200
  ## Create DataLoader for Webcam Image
201
  webcam_ds = dataset_prod_obj.create_dataset(picture, webcam=True)
202
  webcam_dl = DataLoader(webcam_ds, batch_size=BATCH_SIZE)
203
+
204
+ # Testing the dataloader
205
+ prod_inputs = next(iter(webcam_dl))
206
+ st.write(prod_inputs['pixel_values'].shape)
207
 
208
  ## Run the predictions
209
+ #prediction = prod_function(model_pretrained, prod_dl, webcam_dl)
210
+ #predictions = torch.cat(prediction, 0).to(device)
211
+ #match_idx = torch.argmin(predictions)
212
 
213
  ## Display the results
214
+ #if predictions[match_idx] <= 0.3:
215
+ # st.write('Welcome: ',image_paths[match_idx].split('/')[-1].split('.')[0])
216
+ #else:
217
+ # st.write("Match not found")