From d5ea215a8fb44c4e6c9efda9177f33de81e60e55 Mon Sep 17 00:00:00 2001 From: Sai Rohit Muralikrishnan Date: Wed, 25 Mar 2026 20:05:22 -0500 Subject: [PATCH] Fix two bugs in load_available_input_data in data.py 1. Initialize cam_K to None so the function doesn't raise UnboundLocalError when K is None and the loaded file has no 'K' key. 2. Assign eval(K) back to K (not cam_K) so the subsequent np.array(K).reshape(3,3) operates on the parsed list instead of the original string, which would fail. --- contact_graspnet/data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contact_graspnet/data.py b/contact_graspnet/data.py index 7b9a55f..1308296 100644 --- a/contact_graspnet/data.py +++ b/contact_graspnet/data.py @@ -301,10 +301,11 @@ def load_available_input_data(p, K=None): """ segmap, rgb, depth, pc_full, pc_colors = None, None, None, None, None + cam_K = None if K is not None: if isinstance(K,str): - cam_K = eval(K) + K = eval(K) cam_K = np.array(K).reshape(3,3) if '.np' in p: