Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -97,13 +97,9 @@ eval_transforms = build_transforms(800, center_crop=False)
|
|
97 |
# display_transforms = build_transforms4display(960, center_crop=False)
|
98 |
|
99 |
def localize_object(image, texts):
|
100 |
-
print(texts)
|
101 |
img_t = eval_transforms(Image.fromarray(image).convert("RGB")) * 255
|
102 |
-
|
103 |
-
print(img_t.shape)
|
104 |
model.eval()
|
105 |
with torch.no_grad():
|
106 |
-
print(img_t[0][:10, :10])
|
107 |
res = model(texts, [{"image": img_t}])
|
108 |
|
109 |
return res
|
|
|
97 |
# display_transforms = build_transforms4display(960, center_crop=False)
|
98 |
|
99 |
def localize_object(image, texts):
|
|
|
100 |
img_t = eval_transforms(Image.fromarray(image).convert("RGB")) * 255
|
|
|
|
|
101 |
model.eval()
|
102 |
with torch.no_grad():
|
|
|
103 |
res = model(texts, [{"image": img_t}])
|
104 |
|
105 |
return res
|