manu commited on
Commit
1f73bd4
1 Parent(s): 2c5b29b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,7 +10,7 @@ from shapely.geometry import Point
10
  import geopandas as gpd
11
  from geopandas import GeoDataFrame
12
 
13
- model = torch.hub.load('facebookresearch/dinov2', 'dinov2_vits14').to("cuda")
14
  model.eval()
15
 
16
  metadata = pd.read_csv("metadatav3.csv")
@@ -57,7 +57,7 @@ def guess_image(img):
57
  img = img.convert('RGB')
58
  print(img)
59
  with torch.no_grad():
60
- features = model(transform(img).to("cuda").unsqueeze(0))[0].cpu()
61
  distances, neighbors = knn.kneighbors(features.unsqueeze(0))
62
 
63
  neighbors = neighbors[0]
 
10
  import geopandas as gpd
11
  from geopandas import GeoDataFrame
12
 
13
+ model = torch.hub.load('facebookresearch/dinov2', 'dinov2_vits14')
14
  model.eval()
15
 
16
  metadata = pd.read_csv("metadatav3.csv")
 
57
  img = img.convert('RGB')
58
  print(img)
59
  with torch.no_grad():
60
+ features = model(transform(img).unsqueeze(0))[0].cpu()
61
  distances, neighbors = knn.kneighbors(features.unsqueeze(0))
62
 
63
  neighbors = neighbors[0]