Unverified Commit 13555fc3 authored by Francisco Massa's avatar Francisco Massa Committed by GitHub

Pass OUTPUT_DIR to Checkpointer during inference (#101)

parent 7402db8b
......@@ -224,12 +224,11 @@ class BoxList(object):
return self
def area(self):
if self.mode == 'xyxy':
TO_REMOVE = 1
box = self.bbox
if self.mode == "xyxy":
TO_REMOVE = 1
area = (box[:, 2] - box[:, 0] + TO_REMOVE) * (box[:, 3] - box[:, 1] + TO_REMOVE)
elif self.mode == 'xywh':
box = self.bbox
elif self.mode == "xywh":
area = box[:, 2] * box[:, 3]
else:
raise RuntimeError("Should not be here")
......
......@@ -60,7 +60,8 @@ def main():
model = build_detection_model(cfg)
model.to(cfg.MODEL.DEVICE)
checkpointer = DetectronCheckpointer(cfg, model)
output_dir = cfg.OUTPUT_DIR
checkpointer = DetectronCheckpointer(cfg, model, save_dir=output_dir)
_ = checkpointer.load(cfg.MODEL.WEIGHT)
iou_types = ("bbox",)
......
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