wwnvp01 commited on
Commit
dd1ec10
·
verified ·
1 Parent(s): 11b1ae2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -38,14 +38,13 @@ def detect(image):
38
  with torch.no_grad():
39
 
40
  # Apply transformations to the image and move it to the appropriate device
41
- image_tensor = transform_image(new_im).to(device)
42
 
43
  # Extract features using the DinoV2 model
44
- dino_embedding = dinov2_vits14(image_tensor.unsqueeze(0)).cpu()
45
- dino_numpy = dinov2_vits14(image_tensor.unsqueeze(0)).cpu().numpy()
46
-
47
- model.eval()
48
 
 
49
  with torch.no_grad():
50
  outputs = model(dino_embedding)
51
  pred_dress_cat = round(torch.argmax(outputs, dim = 1).tolist()[0])
 
38
  with torch.no_grad():
39
 
40
  # Apply transformations to the image and move it to the appropriate device
41
+ image_tensor = transform_image(new_im).to(device)
42
 
43
  # Extract features using the DinoV2 model
44
+ dino_embedding = dinov2_vits14(image_tensor.unsqueeze(0)).cpu()
45
+ dino_numpy = dinov2_vits14(image_tensor.unsqueeze(0)).cpu().numpy()
 
 
46
 
47
+
48
  with torch.no_grad():
49
  outputs = model(dino_embedding)
50
  pred_dress_cat = round(torch.argmax(outputs, dim = 1).tolist()[0])