Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -7,4 +7,94 @@ sdk: static
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 11 |
+
|
| 12 |
+
# Human-Robot Collaboration Failure Browser
|
| 13 |
+
|
| 14 |
+
- browse all failure categories
|
| 15 |
+
- open a category detail page with its definition and representative example
|
| 16 |
+
- inspect every coded segment attached to that category
|
| 17 |
+
- search all coded segments across the dataset
|
| 18 |
+
|
| 19 |
+
## Project Structure
|
| 20 |
+
|
| 21 |
+
```text
|
| 22 |
+
.
|
| 23 |
+
|-- index.html # Homepage with failure category cards
|
| 24 |
+
|-- category.html # Detail page for one failure category
|
| 25 |
+
|-- all_videos.html # Searchable table of all coded segments
|
| 26 |
+
|-- assets/
|
| 27 |
+
| |-- css/ # Shared and page-specific styles
|
| 28 |
+
| `-- js/
|
| 29 |
+
| |-- failures.js # Failure definitions and metadata
|
| 30 |
+
| |-- homepage.js # Homepage search + category stats
|
| 31 |
+
| |-- category.js # Category page rendering
|
| 32 |
+
| |-- all_videos.js # All-videos table rendering
|
| 33 |
+
| `-- video_segment.js # Video loop/playback behavior
|
| 34 |
+
|-- raw_data.csv # Original Label Studio export
|
| 35 |
+
|-- cleaned_data.csv # Flattened CSV used by the web app
|
| 36 |
+
|-- clean.py # Converts raw_data.csv -> cleaned_data.csv
|
| 37 |
+
`-- videos/ # Source MP4 files referenced by the app
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
## Data Files
|
| 42 |
+
|
| 43 |
+
### `raw_data.csv`
|
| 44 |
+
|
| 45 |
+
This is the original annotation export. It contains:
|
| 46 |
+
|
| 47 |
+
- `id`
|
| 48 |
+
- `participant`
|
| 49 |
+
- `condition`
|
| 50 |
+
- `run`
|
| 51 |
+
- `filename`
|
| 52 |
+
- `videoLabels`
|
| 53 |
+
|
| 54 |
+
The `videoLabels` column stores Label Studio timeline annotations as JSON.
|
| 55 |
+
|
| 56 |
+
### `cleaned_data.csv`
|
| 57 |
+
|
| 58 |
+
This is the flattened file the app actually uses. It contains one row per coded label occurrence:
|
| 59 |
+
|
| 60 |
+
- `filename`
|
| 61 |
+
- `video_id`
|
| 62 |
+
- `video_path`
|
| 63 |
+
- `label`
|
| 64 |
+
- `start`
|
| 65 |
+
- `end`
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
## Video Playback Rules
|
| 69 |
+
|
| 70 |
+
Segment playback behavior is implemented in `assets/js/video_segment.js`.
|
| 71 |
+
|
| 72 |
+
Each embedded video:
|
| 73 |
+
|
| 74 |
+
- lazy-loads when it gets near the viewport
|
| 75 |
+
- starts from a computed frame-based window
|
| 76 |
+
- loops only within the relevant segment
|
| 77 |
+
- respects manual pause and scrubbing
|
| 78 |
+
|
| 79 |
+
Some labels have custom playback behavior. For example:
|
| 80 |
+
|
| 81 |
+
- `Success` and `Failure` play the full video
|
| 82 |
+
- `Safety Avoidance` and `Redundant Retrieval` play from the annotated start to the end of the video
|
| 83 |
+
- `Missed Grab` and `Slippage` expand the playback window around the annotation
|
| 84 |
+
|
| 85 |
+
Default FPS is set to `30`.
|
| 86 |
+
|
| 87 |
+
## Typical Update Workflow
|
| 88 |
+
|
| 89 |
+
1. Replace or update `raw_data.csv`.
|
| 90 |
+
2. Run `python3 clean.py`.
|
| 91 |
+
3. Confirm `cleaned_data.csv` was regenerated correctly.
|
| 92 |
+
4. Add or update files in `videos/` if needed.
|
| 93 |
+
5. Start a local server and verify `index.html`, `category.html`, and `all_videos.html`.
|
| 94 |
+
|
| 95 |
+
## Current Dataset Snapshot
|
| 96 |
+
|
| 97 |
+
At the time of this README update, the repository contains:
|
| 98 |
+
|
| 99 |
+
- `288` data rows in `raw_data.csv` excluding the header
|
| 100 |
+
- `657` data rows in `cleaned_data.csv` excluding the header
|