Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
lf-zhao committed May 10, 2024
1 parent 51bf569 commit 86ef996
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions predicators/spot_utils/perception/object_perception.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,11 @@ def vlm_predicate_batch_classify(

# Update the atoms with the results
if get_dict:
# Return all ground atoms with True/False/None
return {atom: result for atom, result in zip(atoms, results)}
else:
hold_atoms = set()
for atom, result in zip(atoms, results):
if result:
hold_atoms.add(atom)
return hold_atoms
# Only return True ground atoms
return {atom for atom, result in zip(atoms, results) if result}


def get_vlm_atom_combinations(objects: Sequence[Object],
Expand Down
2 changes: 1 addition & 1 deletion predicators/spot_utils/skills/spot_find_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _find_objects_with_choreographed_moves(
for atom, result in vlm_atom_dict.items():
if all_vlm_atom_dict[atom] is None and result is not None:
all_vlm_atom_dict[atom] = result
print(f"Calculated VLM atoms: {all_vlm_atom_dict}")
print(f"Calculated VLM atoms: {dict(all_vlm_atom_dict)}")
else:
# No VLM predicates or no objects found yet
pass
Expand Down

0 comments on commit 86ef996

Please sign in to comment.