Spaces:
Running
Running
Amol Kaushik commited on
Commit ·
2e9c848
1
Parent(s): 10b549c
report update
Browse files- A8/A8_Report.ipynb +8 -92
A8/A8_Report.ipynb
CHANGED
|
@@ -6,38 +6,22 @@
|
|
| 6 |
"metadata": {},
|
| 7 |
"source": [
|
| 8 |
"\n",
|
| 9 |
-
"# A8 Report
|
| 10 |
-
"\n",
|
| 11 |
-
"**Course sprint deliverable:** A8 notebook documenting installation, usage, software changes, data formats, and results for the MoveNet-based pose estimation pipeline.\n",
|
| 12 |
-
"\n",
|
| 13 |
-
"**Prepared for:** Sprint 8 group project \n",
|
| 14 |
-
"**Primary references:** `A8/pose_estimator.py`, `A8/keypoint_extractor.py` API target, sample images `test_person.jpg` and `test_person_annotated.jpg`\n",
|
| 15 |
"\n",
|
| 16 |
"---\n",
|
| 17 |
"\n",
|
| 18 |
"## Introduction & Objectives\n",
|
| 19 |
"\n",
|
| 20 |
-
"This notebook documents the current pose estimation system, how to install and run it, the main architectural decisions, and the data formats used
|
| 21 |
-
"\n",
|
| 22 |
-
"### Objectives\n",
|
| 23 |
-
"- Provide a reproducible environment setup.\n",
|
| 24 |
-
"- Explain the MoveNet pose estimation library and how it is integrated.\n",
|
| 25 |
-
"- Walk through the current code and highlight the software changes added by the team.\n",
|
| 26 |
-
"- Show executable usage examples for image and video processing.\n",
|
| 27 |
-
"- Document CSV and JSON output schemas.\n",
|
| 28 |
-
"- Visualize extraction results and sample output data.\n",
|
| 29 |
-
"- Summarize the system status and next implementation steps.\n",
|
| 30 |
"\n",
|
| 31 |
-
"###
|
| 32 |
"The uploaded `pose_estimator.py` module already provides:\n",
|
| 33 |
"- MoveNet model loading from TensorFlow Hub\n",
|
| 34 |
"- Image preprocessing\n",
|
| 35 |
"- Single-image pose detection\n",
|
| 36 |
"- Video frame-by-frame pose extraction\n",
|
| 37 |
"- Skeleton overlay rendering\n",
|
| 38 |
-
"- CLI entry points for image, video, and webcam usage\n"
|
| 39 |
-
"\n",
|
| 40 |
-
"This report also includes a lightweight compatibility wrapper for the expected `KeypointExtractor` API so the notebook examples can be run in a consistent way once dependencies are installed.\n"
|
| 41 |
]
|
| 42 |
},
|
| 43 |
{
|
|
@@ -48,21 +32,6 @@
|
|
| 48 |
"\n",
|
| 49 |
"## Environment Setup & Installation\n",
|
| 50 |
"\n",
|
| 51 |
-
"### Supported environment\n",
|
| 52 |
-
"- **Python:** 3.10 or 3.11 recommended\n",
|
| 53 |
-
"- **OS:** Windows, macOS, or Linux\n",
|
| 54 |
-
"- **Hardware:** CPU works; GPU is optional and can improve TensorFlow inference speed\n",
|
| 55 |
-
"\n",
|
| 56 |
-
"### Required dependencies\n",
|
| 57 |
-
"| Package | Recommended version | Purpose |\n",
|
| 58 |
-
"|---|---:|---|\n",
|
| 59 |
-
"| tensorflow | `>=2.13,<3.0` | Core deep learning runtime |\n",
|
| 60 |
-
"| tensorflow-hub | `>=0.16` | Loads MoveNet model from TF Hub |\n",
|
| 61 |
-
"| opencv-python | `>=4.8` | Image/video I/O and drawing |\n",
|
| 62 |
-
"| numpy | `>=1.24` | Array operations |\n",
|
| 63 |
-
"| pandas | `>=2.0` | CSV/JSON export and tabular inspection |\n",
|
| 64 |
-
"| matplotlib | `>=3.7` | Notebook plotting and visualization |\n",
|
| 65 |
-
"\n",
|
| 66 |
"### Installation steps\n",
|
| 67 |
"\n",
|
| 68 |
"#### 1. Create and activate a virtual environment\n",
|
|
@@ -93,13 +62,7 @@
|
|
| 93 |
"#### 4. Verify installation\n",
|
| 94 |
"```bash\n",
|
| 95 |
"python -c \"import tensorflow as tf; import tensorflow_hub as hub; import cv2; import numpy; import pandas; print(tf.__version__)\"\n",
|
| 96 |
-
"```
|
| 97 |
-
"\n",
|
| 98 |
-
"### Troubleshooting notes\n",
|
| 99 |
-
"- If TensorFlow fails to install, check that the Python version is supported by the selected TensorFlow release.\n",
|
| 100 |
-
"- On Apple Silicon, use a Python/TensorFlow combination that is explicitly supported by the installed wheel.\n",
|
| 101 |
-
"- If OpenCV video codecs fail, test image mode first and then verify codec support for local MP4 files.\n",
|
| 102 |
-
"- The first MoveNet load may take longer because TensorFlow Hub downloads and caches the model.\n"
|
| 103 |
]
|
| 104 |
},
|
| 105 |
{
|
|
@@ -162,7 +125,7 @@
|
|
| 162 |
"\n",
|
| 163 |
"## Pose Estimation Library Overview\n",
|
| 164 |
"\n",
|
| 165 |
-
"###
|
| 166 |
"MoveNet is a lightweight single-person pose estimation model distributed through TensorFlow Hub. It outputs **17 COCO keypoints**, each with:\n",
|
| 167 |
"\n",
|
| 168 |
"- `x`: normalized horizontal coordinate in the range `[0, 1]`\n",
|
|
@@ -177,7 +140,7 @@
|
|
| 177 |
"| `lightning` | 192 x 192 | Faster inference, slightly lower accuracy |\n",
|
| 178 |
"| `thunder` | 256 x 256 | Slower inference, higher accuracy |\n",
|
| 179 |
"\n",
|
| 180 |
-
"###
|
| 181 |
"The code defines the standard 17 COCO keypoints:\n",
|
| 182 |
"\n",
|
| 183 |
"`nose, left_eye, right_eye, left_ear, right_ear, left_shoulder, right_shoulder, left_elbow, right_elbow, left_wrist, right_wrist, left_hip, right_hip, left_knee, right_knee, left_ankle, right_ankle`\n",
|
|
@@ -205,7 +168,6 @@
|
|
| 205 |
"## Code Walkthrough & Changes\n",
|
| 206 |
"\n",
|
| 207 |
"### Module structure\n",
|
| 208 |
-
"The uploaded module is centered on a single class:\n",
|
| 209 |
"\n",
|
| 210 |
"- `MoveNetPoseEstimator`\n",
|
| 211 |
" - model loading\n",
|
|
@@ -243,19 +205,7 @@
|
|
| 243 |
"4. **Video processing pipeline**\n",
|
| 244 |
" - Reads video frame-by-frame, runs inference, stores per-frame results, and optionally writes an annotated MP4.\n",
|
| 245 |
"5. **CLI support**\n",
|
| 246 |
-
" - Adds `--image`, `--video`, `--webcam`, `--output`, and model selection flags for local testing.\n"
|
| 247 |
-
"\n",
|
| 248 |
-
"### Suggested wrapper for the expected issue API\n",
|
| 249 |
-
"The issue description expects:\n",
|
| 250 |
-
"\n",
|
| 251 |
-
"```python\n",
|
| 252 |
-
"from keypoint_extractor import KeypointExtractor\n",
|
| 253 |
-
"extractor = KeypointExtractor(model='movenet')\n",
|
| 254 |
-
"keypoints = extractor.extract_from_video('video.mp4')\n",
|
| 255 |
-
"extractor.save_to_csv(keypoints, 'output.csv')\n",
|
| 256 |
-
"```\n",
|
| 257 |
-
"\n",
|
| 258 |
-
"The next cell implements a notebook-local compatibility wrapper with that API. This keeps the report executable even if `keypoint_extractor.py` has not yet been committed locally.\n"
|
| 259 |
]
|
| 260 |
},
|
| 261 |
{
|
|
@@ -802,40 +752,6 @@
|
|
| 802 |
"plt.tight_layout()\n",
|
| 803 |
"plt.show()\n"
|
| 804 |
]
|
| 805 |
-
},
|
| 806 |
-
{
|
| 807 |
-
"cell_type": "markdown",
|
| 808 |
-
"id": "7309d3d4",
|
| 809 |
-
"metadata": {},
|
| 810 |
-
"source": [
|
| 811 |
-
"\n",
|
| 812 |
-
"## Conclusions\n",
|
| 813 |
-
"\n",
|
| 814 |
-
"### What is complete in this report\n",
|
| 815 |
-
"- The notebook includes all requested A8 sections.\n",
|
| 816 |
-
"- Installation steps are documented and reproducible.\n",
|
| 817 |
-
"- The current `pose_estimator.py` architecture is described.\n",
|
| 818 |
-
"- The expected `KeypointExtractor` API is documented and supported by a notebook-local compatibility wrapper.\n",
|
| 819 |
-
"- CSV and JSON output formats are documented with examples.\n",
|
| 820 |
-
"- Visualization examples compare input and skeleton overlay output.\n",
|
| 821 |
-
"\n",
|
| 822 |
-
"### Recommended follow-up commit items\n",
|
| 823 |
-
"1. Add a project-level `requirements.txt` or `environment.yml`.\n",
|
| 824 |
-
"2. Commit `keypoint_extractor.py` as a thin wrapper around `MoveNetPoseEstimator`.\n",
|
| 825 |
-
"3. Add one short sample video or test clip for reproducible notebook demonstration.\n",
|
| 826 |
-
"4. Add automated tests for:\n",
|
| 827 |
-
" - image inference return structure\n",
|
| 828 |
-
" - CSV export schema\n",
|
| 829 |
-
" - JSON export schema\n",
|
| 830 |
-
" - invalid file path handling\n",
|
| 831 |
-
"\n",
|
| 832 |
-
"### Acceptance criteria check\n",
|
| 833 |
-
"- **Complete A8 notebook with all sections:** yes\n",
|
| 834 |
-
"- **Installation reproducible from documentation:** yes\n",
|
| 835 |
-
"- **Code examples executable in notebook:** yes, once the documented dependencies are installed\n",
|
| 836 |
-
"- **Data formats clearly documented:** yes\n",
|
| 837 |
-
"- **Visualizations demonstrate working system:** yes\n"
|
| 838 |
-
]
|
| 839 |
}
|
| 840 |
],
|
| 841 |
"metadata": {
|
|
|
|
| 6 |
"metadata": {},
|
| 7 |
"source": [
|
| 8 |
"\n",
|
| 9 |
+
"# A8 Report\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"\n",
|
| 11 |
"---\n",
|
| 12 |
"\n",
|
| 13 |
"## Introduction & Objectives\n",
|
| 14 |
"\n",
|
| 15 |
+
"This notebook documents the current pose estimation system, how to install and run it, the main architectural decisions, and the data formats used.\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
"\n",
|
| 17 |
+
"### Pose estimator\n",
|
| 18 |
"The uploaded `pose_estimator.py` module already provides:\n",
|
| 19 |
"- MoveNet model loading from TensorFlow Hub\n",
|
| 20 |
"- Image preprocessing\n",
|
| 21 |
"- Single-image pose detection\n",
|
| 22 |
"- Video frame-by-frame pose extraction\n",
|
| 23 |
"- Skeleton overlay rendering\n",
|
| 24 |
+
"- CLI entry points for image, video, and webcam usage\n"
|
|
|
|
|
|
|
| 25 |
]
|
| 26 |
},
|
| 27 |
{
|
|
|
|
| 32 |
"\n",
|
| 33 |
"## Environment Setup & Installation\n",
|
| 34 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
"### Installation steps\n",
|
| 36 |
"\n",
|
| 37 |
"#### 1. Create and activate a virtual environment\n",
|
|
|
|
| 62 |
"#### 4. Verify installation\n",
|
| 63 |
"```bash\n",
|
| 64 |
"python -c \"import tensorflow as tf; import tensorflow_hub as hub; import cv2; import numpy; import pandas; print(tf.__version__)\"\n",
|
| 65 |
+
"```"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
]
|
| 67 |
},
|
| 68 |
{
|
|
|
|
| 125 |
"\n",
|
| 126 |
"## Pose Estimation Library Overview\n",
|
| 127 |
"\n",
|
| 128 |
+
"### MoveNet\n",
|
| 129 |
"MoveNet is a lightweight single-person pose estimation model distributed through TensorFlow Hub. It outputs **17 COCO keypoints**, each with:\n",
|
| 130 |
"\n",
|
| 131 |
"- `x`: normalized horizontal coordinate in the range `[0, 1]`\n",
|
|
|
|
| 140 |
"| `lightning` | 192 x 192 | Faster inference, slightly lower accuracy |\n",
|
| 141 |
"| `thunder` | 256 x 256 | Slower inference, higher accuracy |\n",
|
| 142 |
"\n",
|
| 143 |
+
"### COCO keypoints\n",
|
| 144 |
"The code defines the standard 17 COCO keypoints:\n",
|
| 145 |
"\n",
|
| 146 |
"`nose, left_eye, right_eye, left_ear, right_ear, left_shoulder, right_shoulder, left_elbow, right_elbow, left_wrist, right_wrist, left_hip, right_hip, left_knee, right_knee, left_ankle, right_ankle`\n",
|
|
|
|
| 168 |
"## Code Walkthrough & Changes\n",
|
| 169 |
"\n",
|
| 170 |
"### Module structure\n",
|
|
|
|
| 171 |
"\n",
|
| 172 |
"- `MoveNetPoseEstimator`\n",
|
| 173 |
" - model loading\n",
|
|
|
|
| 205 |
"4. **Video processing pipeline**\n",
|
| 206 |
" - Reads video frame-by-frame, runs inference, stores per-frame results, and optionally writes an annotated MP4.\n",
|
| 207 |
"5. **CLI support**\n",
|
| 208 |
+
" - Adds `--image`, `--video`, `--webcam`, `--output`, and model selection flags for local testing.\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
]
|
| 210 |
},
|
| 211 |
{
|
|
|
|
| 752 |
"plt.tight_layout()\n",
|
| 753 |
"plt.show()\n"
|
| 754 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 755 |
}
|
| 756 |
],
|
| 757 |
"metadata": {
|