{"id":28195650,"url":"https://github.com/manuelmariscal/biomedical_workshops","last_synced_at":"2025-05-16T14:14:02.397Z","repository":{"id":247496255,"uuid":"826005430","full_name":"manuelmariscal/biomedical_workshops","owner":"manuelmariscal","description":"This repo is focused on movement analysis workshops, mainly using computational vision and AI, repo is still a work in progress. ","archived":false,"fork":false,"pushed_at":"2024-08-12T23:25:24.000Z","size":325,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-13T01:58:59.964Z","etag":null,"topics":["biomedical-engineering","computational-vision","movement-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manuelmariscal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-08T23:44:59.000Z","updated_at":"2024-08-12T23:25:27.000Z","dependencies_parsed_at":"2024-08-13T01:44:15.979Z","dependency_job_id":"5c8fa47b-0b87-4d50-9b96-93987513dc52","html_url":"https://github.com/manuelmariscal/biomedical_workshops","commit_stats":null,"previous_names":["manuelmariscal/biomedical_workshops"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelmariscal%2Fbiomedical_workshops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelmariscal%2Fbiomedical_workshops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelmariscal%2Fbiomedical_workshops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelmariscal%2Fbiomedical_workshops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manuelmariscal","download_url":"https://codeload.github.com/manuelmariscal/biomedical_workshops/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544778,"owners_count":22088808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biomedical-engineering","computational-vision","movement-analysis"],"created_at":"2025-05-16T14:14:01.589Z","updated_at":"2025-05-16T14:14:02.390Z","avatar_url":"https://github.com/manuelmariscal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Biomedical Workshops\n\n## Real-time Movement Analysis for Biomedical Engineers\n\nThis repository contains a real-time movement analysis tool using video capture and Mediapipe's pose estimation. The tool is designed to help biomedical engineering students track and analyze movements using a laptop camera or a connected mobile phone camera. The analysis can be performed in real-time or on recorded data, and various metrics and visualizations are provided.\n\n### Features\n\n- **Real-time movement tracking** using Mediapipe and OpenCV.\n- **Capture video** from a laptop camera or a mobile phone camera.\n- **Extract and track key points** of interest (e.g., ankles, knees, hips, shoulders, elbows, wrists, and center of gravity).\n- **Save tracked data** to CSV files for further analysis.\n- **Analyze movement data** with various analytical tools.\n- **Calculate correlations** between movements.\n- **Visualize correlation matrices** and skeleton heatmaps.\n- **Multiple modes of operation**:\n  - **track**: Capture and track movements in real-time.\n  - **analyze**: Analyze saved movement data.\n  - **corr**: Compute and visualize correlations between movement datasets.\n\n### Repository Structure\n\n```bash\nbiomedical_workshops/\n├── main.py\n├── README.md\n├── requirements.txt\n└── src/\n    ├── tracking.py\n    ├── corr.py\n    └── analysis.py\n```\n\n### Installation\n\n1. **Clone the repository**:\n\n    ```bash\n    git clone https://github.com/manuelmariscal/biomedical_workshops.git\n    cd biomedical_workshops\n    ```\n\n2. **Create a virtual environment** and activate it:\n\n    ```bash\n    python -m venv bioworkshops\n    # On Windows:\n    bioworkshops\\Scripts\\activate\n    # On Unix or MacOS:\n    source bioworkshops/bin/activate\n    ```\n\n3. **Install the required dependencies**:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n### Usage\n\nThe tool operates in different modes: `track`, `analyze`, and `corr`. You can specify the mode using the `--mode` argument.\n\n#### Tracking Mode (`track`)\n\nTo run the real-time movement tracking:\n\n```bash\npython main.py --mode track --source 0\n```\n\nWhere `0` is the default source for the laptop camera. You can also use a URL or another device index for a mobile phone camera or an external camera.\n\n#### Analysis Mode (`analyze`)\n\nTo analyze saved movement data:\n\n```bash\npython main.py --mode analyze --data_folder data\n```\n\nThis mode processes the CSV files in the specified `data_folder` and performs analysis, including plotting movements and calculating metrics.\n\n#### Correlation Mode (`corr`)\n\nTo compute and visualize correlations between movement datasets:\n\n```bash\npython main.py --mode corr --data_folder data\n```\n\nThis mode processes the CSV files in the specified `data_folder`, computes correlation matrices between pairs of datasets, and visualizes the results, including skeleton heatmaps.\n\n#### Arguments\n\n- `--mode`: Mode of operation (`track`, `analyze`, or `corr`).\n- `--source`: Video source (e.g., `0` for laptop camera, URL for mobile camera). Used only in `track` mode.\n- `--data_folder`: Folder where CSV data files are stored. Used in `analyze` and `corr` modes.\n\n### Data Analysis\n\nThe tool captures video data and extracts key points of interest, saving the results in CSV files within the specified `data_folder`. It provides various visualizations and analyses, depending on the mode:\n\n1. **Tracking Mode (`track`)**:\n   - **Real-time skeleton movement**: Displays the real-time movement of the skeleton with tracked key points and lines connecting them.\n   - **Data Saving**: Saves the tracked data to CSV files for later analysis.\n\n2. **Analysis Mode (`analyze`)**:\n   - **Movement Plots**: Visualizes the movements from the saved data.\n   - **Animations**: Creates animations comparing valid and invalid movements.\n   - **Correlation Calculations**: Computes correlations between movements.\n\n3. **Correlation Mode (`corr`)**:\n   - **Correlation Matrices**: Generates and displays correlation matrices for each pair of movement datasets.\n   - **Skeleton Heatmaps**: Plots the skeleton with a heatmap based on average keypoint correlations.\n     - **Correct Orientation**: The skeleton is displayed with the correct orientation.\n     - **Enhanced Visualization**: Thicker lines and larger keypoints are used for better visibility.\n     - **Blue Color Map**: A blue color map is used for the heatmap.\n   - **Visualization of Results**: Both the correlation matrices and the skeleton heatmap are displayed simultaneously with appropriate titles.\n\n### Example\n\nTo run the tool in `corr` mode and analyze data in the `data` folder:\n\n```bash\npython main.py --mode corr --data_folder data\n```\n\n### Contributing\n\nFeel free to contribute to this project by opening issues or submitting pull requests. Please ensure your code follows the coding standards and includes tests where applicable.\n\n### License\n\nThis project is licensed under the MIT License.\n\n### Acknowledgments\n\nThis project uses the following libraries:\n\n- [Mediapipe](https://google.github.io/mediapipe/)\n- [OpenCV](https://opencv.org/)\n- [NumPy](https://numpy.org/)\n- [Pandas](https://pandas.pydata.org/)\n- [Matplotlib](https://matplotlib.org/)\n- [SciPy](https://www.scipy.org/)\n\n---\n\nFor more information, please visit the [project repository](https://github.com/manuelmariscal/biomedical_workshops).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelmariscal%2Fbiomedical_workshops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelmariscal%2Fbiomedical_workshops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelmariscal%2Fbiomedical_workshops/lists"}