Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,15 +32,20 @@ model.eval()
|
|
32 |
# model_path = "./last.pt"
|
33 |
# model = torch.jit.load(model_path, map_location=torch.device("cpu"))
|
34 |
# model.eval()
|
35 |
-
|
36 |
-
|
37 |
-
transforms.Resize((
|
38 |
-
transforms.ToTensor()
|
39 |
])
|
|
|
|
|
|
|
|
|
40 |
|
41 |
OBJECT_NAMES = ['enemies']
|
42 |
|
43 |
def detect_objects_in_image(image):
|
|
|
44 |
img_tensor = transform(image).unsqueeze(0)
|
45 |
orig_w, orig_h = image.size
|
46 |
|
|
|
32 |
# model_path = "./last.pt"
|
33 |
# model = torch.jit.load(model_path, map_location=torch.device("cpu"))
|
34 |
# model.eval()
|
35 |
+
transform=transforms.Compose([
|
36 |
+
transforms.ToPILImage(),
|
37 |
+
transforms.Resize((512,640)),
|
38 |
+
transforms.ToTensor()
|
39 |
])
|
40 |
+
# transform = transforms.Compose([
|
41 |
+
# transforms.Resize((640, 640)),
|
42 |
+
# transforms.ToTensor(),
|
43 |
+
# ])
|
44 |
|
45 |
OBJECT_NAMES = ['enemies']
|
46 |
|
47 |
def detect_objects_in_image(image):
|
48 |
+
|
49 |
img_tensor = transform(image).unsqueeze(0)
|
50 |
orig_w, orig_h = image.size
|
51 |
|