renezurbruegg / icg_benchmark

Grasping Benchmark for Instance Centric Graspnet
MIT License
2 stars 0 forks source link

How to transfer to target-driven grasp? #7

Open RanDing2000 opened 2 weeks ago

RanDing2000 commented 2 weeks ago

Hi, if I know the instance id of target object, and want to obtain the grasp pose of the target object, is this method feasible? I make modifications in the code of icg_benchmark/grasping/planners/icgnet.py

        ori, ctc, score, width, instance = output.scene_grasp_poses
        # numpy_to_ply(ctc.cpu().numpy(), '/usr/stud/dira/GraspInClutter/icg_benchmark/demo/demo_ctc.ply')
        # mask = score > self.confidence_th
        mask = (score > self.confidence_th) & (instance == targ_instance_id)
        if not mask.any():
            print(
                colored(
                    "no candidates with high score" + f"{str(score.max()) if len(score) > 0 else 'No pts'}",
                    "yellow",
                )
            )
       return None