Skip to content

Commit

Permalink
BGR support in eval
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanklut committed Dec 4, 2023
1 parent 2b44f6c commit e13cec3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@ def create_gt_visualization(image_filename, sem_seg_filename):
def create_pred_visualization(image_filename):
image = load_image(image_filename)
logger.info(f"Predict: {image_filename}")
outputs = predictor(image)
if cfg.INPUT.FORMAT == "BGR":
input_image = image[..., ::-1]
else:
input_image = image
outputs = predictor(input_image)
pred = torch.argmax(outputs[0]["sem_seg"], dim=-3).to("cpu")
# outputs["panoptic_seg"] = (outputs["panoptic_seg"][0].to("cpu"),
# outputs["panoptic_seg"][1])
Expand Down

0 comments on commit e13cec3

Please sign in to comment.