Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shape mismatch error in running inference code #20

Open
AliBuildsAI opened this issue Mar 5, 2021 · 0 comments
Open

Shape mismatch error in running inference code #20

AliBuildsAI opened this issue Mar 5, 2021 · 0 comments

Comments

@AliBuildsAI
Copy link

Hi,
I am trying to run your code and got the following error:

Traceback (most recent call last):
  File "tools/5_evaluation_bop_basic.py", line 310, in <module>
    obj_pix2pose[obj_order_id].est_pose(image_t,roi.astype(np.int))            
  File "/host_home/repos/Pix2Pose/pix2pose_model/recognition.py", line 89, in est_pose
    base_image[vv1:vv2,uu1:uu2] = image_no_mask_zero
ValueError: could not broadcast input array from shape (462,56,3) into shape (0,56,3)

I have tracked the code, and it happened when some of the bounding box indices are negative, and the shifting does not work sometimes.
Below are the numbers that the error happens for them:
Inpix2pose.get_boxes() method, the bbox input is: [-65 128 -27 163]
v_max, u_maxare 480, 640, respectively.
and the output for vv1,vv2,uu1,uu2 are 71 52 0 52.
The value for vv1, vv2 pair is clearly wrong. Could you please help?

Below is my config file:

{
  "backbone":"resnet50",
  "dataset_dir": "/host_home/repos/Pix2Pose/datasets",
  "dataset_names": ["lmo"],
  "detection_pipeline": "rcnn",
  "path_to_detection_pipeline": "/home/kiru/common_ws/Mask_RCNN_Mod" ,  
  "path_to_output": "./bop_result_ali" ,
  "outlier_th":[0.15,0.25,0.35],
  "inlier_th":0.15,
  "norm_factor_fn":"norm_factor.json",
  "background_imgs_for_training":"/home/kiru/media/hdd/datasets/coco2017/train2017/",
  "score_type":1,
  "task_type":2,
  "cand_factor":2,
  "test_target":"test_targets_bop19"  
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant