Commit ef8a93b1 authored by Henry Wang's avatar Henry Wang Committed by Francisco Massa

Fix the AssertionError when calling masker in coco_eval.py (#213)

* fix the same issue as #185

* add fix from the previous change
parent 75dee47c
...@@ -116,7 +116,10 @@ def prepare_for_coco_segmentation(predictions, dataset): ...@@ -116,7 +116,10 @@ def prepare_for_coco_segmentation(predictions, dataset):
prediction = prediction.resize((image_width, image_height)) prediction = prediction.resize((image_width, image_height))
masks = prediction.get_field("mask") masks = prediction.get_field("mask")
# t = time.time() # t = time.time()
masks = masker(masks, prediction) # Masker is necessary only if masks haven't been already resized.
if list(masks.shape[-2:]) != [image_height, image_width]:
masks = masker(masks.expand(1, -1, -1, -1, -1), prediction)
masks = masks[0]
# logger.info('Time mask: {}'.format(time.time() - t)) # logger.info('Time mask: {}'.format(time.time() - t))
# prediction = prediction.convert('xywh') # prediction = prediction.convert('xywh')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment