jinlinyi commited on
Commit
2f71d77
1 Parent(s): 8a59b10

add focal length as output

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -138,7 +138,7 @@ def inference(img, model_type):
138
  pred['pred_rel_cx'].cpu().item(),
139
  pred['pred_rel_cy'].cpu().item(),
140
  ]
141
- param = f"roll {pred['pred_roll'].cpu().item() :.2f}\npitch {pred['pred_pitch'].cpu().item() :.2f}\nfov {pred['pred_general_vfov'].cpu().item() :.2f}\n"
142
  param += f"principal point {pred['pred_rel_cx'].cpu().item() :.2f} {pred['pred_rel_cy'].cpu().item() :.2f}"
143
  pred_vis = draw_from_r_p_f_cx_cy(
144
  img[:,:,::-1],
 
138
  pred['pred_rel_cx'].cpu().item(),
139
  pred['pred_rel_cy'].cpu().item(),
140
  ]
141
+ param = f"roll {pred['pred_roll'].cpu().item() :.2f}\npitch {pred['pred_pitch'].cpu().item() :.2f}\nvfov {pred['pred_general_vfov'].cpu().item() :.2f}\nfocal_length {pred['pred_rel_focal'].cpu().item()*img.shape[0] :.2f}\n"
142
  param += f"principal point {pred['pred_rel_cx'].cpu().item() :.2f} {pred['pred_rel_cy'].cpu().item() :.2f}"
143
  pred_vis = draw_from_r_p_f_cx_cy(
144
  img[:,:,::-1],