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

Vlm pipeline testing #292

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4e13836
Initial commit.
ashay-bdai Sep 9, 2024
0a25b2d
Some more progress.
ashay-bdai Sep 10, 2024
e62e8cf
Some more progress.
ashay-bdai Sep 10, 2024
aed5708
More progress after pair programming.
ashay-bdai Sep 10, 2024
c832fb0
Get plumbing to work.
ashay-bdai Sep 11, 2024
ea5f1bf
initial test working
ashay-bdai Sep 11, 2024
0b8d125
Rotate spot camera images.
ashay-bdai Sep 11, 2024
d255810
Play-test other VLM predicates and update annotation in spot images.
ashay-bdai Sep 12, 2024
803683d
making some progress; took way longer than expected though...
NishanthJKumar Sep 12, 2024
cf40334
Progress towards object detection result.
ashay-bdai Sep 13, 2024
369b399
finish up implementation!
NishanthJKumar Sep 13, 2024
94dff09
Get camera annotation + object detection annotation to work on all im…
ashay-bdai Sep 14, 2024
aec3f86
Update annotation text font and background.
ashay-bdai Sep 15, 2024
ac9fc2f
Run autoformatter.
ashay-bdai Sep 15, 2024
5a461cc
Fix indent.
ashay-bdai Sep 16, 2024
c4c978f
fixes for comments
NishanthJKumar Sep 16, 2024
199698e
autoformat
NishanthJKumar Sep 16, 2024
9ce43d3
Merge branch 'vlm-pipeline-testing' into change-perceiver-to-have-his…
ashay-bdai Sep 16, 2024
37b5245
Merge pull request #293 from bdaiinstitute/change-perceiver-to-have-h…
ashay-bdai Sep 16, 2024
6e25b72
Add last skill execution to _TruncatedSpotObservation.
ashay-bdai Sep 16, 2024
fe7da30
Debugging progressm.
ashay-bdai Sep 16, 2024
4cc0336
Some progress towards fixing vlm atom history.
ashay-bdai Sep 17, 2024
41b58ea
Progress towards passing history into VLM at test time.
ashay-bdai Sep 17, 2024
71fe6d3
Update and fix computation of history and how it gets passed into the…
ashay-bdai Sep 17, 2024
5232fa2
Fix bugs related to image history to VLM and abstracting the state.
ashay-bdai Sep 17, 2024
6303130
Fix skill action history in case of done action.
ashay-bdai Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion predicators/approaches/base_approach.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from predicators.structs import Action, Dataset, InteractionRequest, \
InteractionResult, Metrics, ParameterizedOption, Predicate, State, Task, \
Type
from predicators.utils import ExceptionWithInfo
from predicators.utils import ExceptionWithInfo, create_vlm_by_name


class BaseApproach(abc.ABC):
Expand All @@ -29,6 +29,7 @@ def __init__(self, initial_predicates: Set[Predicate],
self._train_tasks = train_tasks
self._metrics: Metrics = defaultdict(float)
self._set_seed(CFG.seed)
self._vlm = create_vlm_by_name(CFG.vlm_model_name) # pragma: no cover

@classmethod
@abc.abstractmethod
Expand Down
4 changes: 3 additions & 1 deletion predicators/approaches/bilevel_planning_approach.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ def _solve(self, task: Task, timeout: int) -> Callable[[State], Action]:
seed = self._seed + self._num_calls
nsrts = self._get_current_nsrts()
preds = self._get_current_predicates()

# utils.abstract(task.init, preds, self._vlm)
# utils.abstract(task.init, preds, self._vlm)
# Run task planning only and then greedily sample and execute in the
# policy.
if self._plan_without_sim:
nsrt_plan, atoms_seq, metrics = self._run_task_plan(
task, nsrts, preds, timeout, seed)
import pdb; pdb.set_trace()
self._last_nsrt_plan = nsrt_plan
self._last_atoms_seq = atoms_seq
policy = utils.nsrt_plan_to_greedy_policy(nsrt_plan, task.goal,
Expand Down
5 changes: 3 additions & 2 deletions predicators/approaches/spot_wrapper_approach.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _solve(self, task: Task, timeout: int) -> Callable[[State], Action]:
def _policy(state: State) -> Action:
nonlocal base_approach_policy, need_stow
# If we think that we're done, return the done action.
if task.goal_holds(state):
if task.goal_holds(state, self._vlm):
extra_info = SpotActionExtraInfo("done", [], None, tuple(),
None, tuple())
return utils.create_spot_env_action(extra_info)
Expand Down Expand Up @@ -102,7 +102,8 @@ def _policy(state: State) -> Action:
self._base_approach_has_control = True
# Need to call this once here to fix off-by-one issue.
atom_seq = self._base_approach.get_execution_monitoring_info()
assert all(a.holds(state) for a in atom_seq[0])
# TODO: consider reinstating the line below.
# assert all(a.holds(state) for a in atom_seq[0])
# Use the base policy.
return base_approach_policy(state)

Expand Down
Loading
Loading