p-doom/crowd-code-dataset-0.2 huggingface dataset:
[content] utils/dataloader.py (python)
        # Validate dimensions match expected values
        if (episode_tensor.shape[1] != self.image_h or 
            episode_tensor.shape[2] != self.image_w or 
            episode_tensor.shape[3] != self.image_c):
            raise ValueError(
                f"Video dimensions mismatch: expected ({self.image_h}, {self.image_w}, {self.image_c}), "
                f"got ({episode_tensor.shape[1]}, {episode_tensor.shape[2]}, {episode_tensor.shape[3]})"
            )
[content] utils/dataloader.py (python)
        # Debug: print what we actually got
        print(f"DEBUG: element type: {type(element)}")
        print(f"DEBUG: element keys: {element.keys() if isinstance(element, dict) else 'Not a dict'}")
        print(f"DEBUG: element content: {element}")
[content] utils/dataloader.py (python)
        # Debug: print what we actually got
        print(f"DEBUG: element type: {type(element)}")
        print(f"DEBUG: element keys: {element.keys() if isinstance(element, dict) else 'Not a dict'}")
        print(f"DEBUG: videos key type: {type(element['videos'])}")
        print(f"DEBUG: videos content: {element['videos']}")
        
        # It seems the data is stored under 'videos' key
        video_data = element["videos"]
        
        # Assuming video_data contains the actual video array or metadata
        # Let's check what structure it has
        if isinstance(video_data, dict):
            # If it's a dict with our expected keys
            video_shape = (
                video_data["sequence_length"],
                video_data["height"],
                video_data["width"],
                video_data["channels"],
            )
            raw_video_bytes = video_data["raw_video"]
        else:
            # If it's the raw video array directly
            # We need to infer the shape from the constructor parameters
            video_shape = (
                self.seq_len,  # Use the requested sequence length
                self.image_h,
                self.image_w,
                self.image_c,
            )
            raw_video_bytes = video_data
[content] utils/dataloader.py (python)
        # Debug: print what we actually got
        print(f"DEBUG: element type: {type(element)}")
        print(f"DEBUG: element keys: {element.keys() if isinstance(element, dict) else 'Not a dict'}")
        print(f"DEBUG: videos key type: {type(element['videos'])}")
        print(f"DEBUG: videos content: {element['videos']}")
        
        # It seems the data is stored under 'videos' key
        video_data = element["videos"]
        
        # Assuming video_data contains the actual video array or metadata
        # Let's check what structure it has
        if isinstance(video_data, dict):
            # If it's a dict with our expected keys
            video_shape = (
                video_data["sequence_length"],
                video_data["height"],
                video_data["width"],
                video_data["channels"],
            )
            raw_video_bytes = video_data["raw_video"]
        else:
            # If it's the raw video array directly
            # We need to infer the shape from the constructor parameters
            video_shape = (
                self.seq_len,  # Use the requested sequence length
                self.image_h,
                self.image_w,
                self.image_c,
            )
            raw_video_bytes = video_data
        episode_tensor = np.frombuffer(raw_video_bytes, dtype=np.uint8)
[content] utils/dataloader.py (python)
        video_shape = (
            element["sequence_length"],
            element["height"],
            element["width"],
            element["channels"],
        )
        episode_tensor = np.frombuffer(element["raw_video"], dtype=np.uint8)
[tab] convert_knoms_to_arrayrecords.py (python)
from utils.dataloader import convert_tfrecords_to_arrayrecords

convert_tfrecords_to_arrayrecords(
    tfrecord_folder="/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/dummy",
    output_folder="/hkfs/work/workspace/scratch/tum_ind3695-jafa_ws_shared/data/dummy_arrayrecords",
)