Spaces:
Sleeping
Sleeping
Update tasks/image.py
Browse files- tasks/image.py +3 -2
tasks/image.py
CHANGED
@@ -185,8 +185,9 @@ async def evaluate_image(request: ImageEvaluationRequest):
|
|
185 |
true_boxes_list = []
|
186 |
|
187 |
for batch_images, batch_annotations in dataloader:
|
188 |
-
image_inputs = feature_extractor(images=batch_images, return_tensors="pt", padding=True).pixel_values
|
189 |
-
|
|
|
190 |
# Perform inference
|
191 |
with torch.no_grad():
|
192 |
outputs = model(pixel_values=image_inputs)
|
|
|
185 |
true_boxes_list = []
|
186 |
|
187 |
for batch_images, batch_annotations in dataloader:
|
188 |
+
# image_inputs = feature_extractor(images=batch_images, return_tensors="pt", padding=True).pixel_values
|
189 |
+
image_inputs = feature_extractor(images=[img.permute(1, 2, 0).numpy() for img in batch_images], return_tensors="pt", padding=True).pixel_values
|
190 |
+
|
191 |
# Perform inference
|
192 |
with torch.no_grad():
|
193 |
outputs = model(pixel_values=image_inputs)
|