Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 0 deletions egomimic/algo/hpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def __init__(

self.diffusion = None


def init_encoder(self, modality, encoder_spec):
"""
Initialize an encoder for the specified modality.
Expand Down Expand Up @@ -683,7 +684,9 @@ def forward(self, domain, data):
if self.diffusion:
features = (features, domain)

self.trunk_features = dict()
if domain in self.heads:
self.trunk_features[domain] = features
action[domain] = self.heads[domain](features)

if self.shared_action:
Expand Down
7 changes: 3 additions & 4 deletions egomimic/scripts/visualization_process/debug/check_zar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def main():
# Default to the outputs produced by `process_image.py`
data_dir = Path("egomimic/scripts/visualization_process/fold_clothes_aria_eva")
data_dir = Path("egomimic/scripts/visualization_process/data2")
manifest_path = data_dir / "manifest.json"
manifest = json.loads(manifest_path.read_text())

Expand All @@ -25,14 +25,13 @@ def main():
for col in ("global_index", "episode_hash"):
print("[INFO] has {} = {}".format(col, col in meta_df.columns))
if len(meta_df) > 0:
first_row = meta_df.iloc[100].to_dict()
first_row = meta_df.iloc[30].to_dict()
breakpoint()
print("[INFO] metadata[0] keys =", sorted(list(first_row.keys()))[:40], "...")
print("[INFO] metadata[0] =", first_row)

# Load embeddings zarr for first image key
first_key = manifest["image_keys"][0]
zarr_path = Path(manifest["embeddings"][first_key])
zarr_path = Path(manifest["embeddings"]["cond"])
root = zarr.open_group(str(zarr_path), mode="r")
arr = root["embeddings"]
print("[INFO] zarr_path =", zarr_path)
Expand Down
Loading