forked from LINCellularNeuroscience/VAME
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from EthoML/dev
dev
- Loading branch information
Showing
47 changed files
with
4,118 additions
and
1,129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build and Release | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Testing] | ||
branches: [main] | ||
types: | ||
- completed | ||
jobs: | ||
pypi-release: | ||
name: Release VAME in pypi | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
pip install twine | ||
- name: Build and publish to PyPI | ||
run: | | ||
python -m build | ||
twine upload dist/* | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
|
||
|
||
jobs: | ||
run: | ||
name: ${{ matrix.os }} Python ${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.11"] | ||
os: [ubuntu-latest, macos-13, windows-latest] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git fetch --prune --unshallow --tags | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install tests dependencies | ||
run: | | ||
python -m pip install -U pip | ||
pip install . --no-cache-dir | ||
pip install -r tests/requirements-tests.txt --no-cache-dir | ||
- name: Run tests. | ||
run: pytest --cov=src/vame --cov-report=xml --cov-report=term-missing -v | ||
|
||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Dockerfile for VAME pipeline | ||
FROM python:3.11-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /vame | ||
|
||
# Copy the vame package to the working directory | ||
COPY requirements.txt /vame | ||
COPY pyproject.toml /vame | ||
COPY src/ /vame/src | ||
|
||
# Copy the demo docker example to working dir | ||
COPY ./examples/demo_docker.py /vame | ||
|
||
# Install vame | ||
RUN pip install --no-cache-dir . | ||
|
||
|
||
CMD ["python", "demo_docker.py"] | ||
|
||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
prune tests | ||
prune docs | ||
prune examples | ||
prune Images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Running the first demo (demo.py) | ||
|
||
The first demo is a simple example of how to use the library. | ||
|
||
## 1. Downloading the necessary resources: | ||
|
||
To run the demo you will need vame package installed, follow the installation guide [here](/README.md#Installation) . | ||
Also you will need two files to properly run the demo: | ||
- `video-1.mp4`: A video file that will be used as input, for the demo you can download from [this link](https://drive.google.com/file/d/1w6OW9cN_-S30B7rOANvSaR9c3O5KeF0c/view) | ||
- `video-1.csv`: the pose estimation results for the video file. You can use the video-1.csv file that is in the examples folder [video](/examples/video-1.csv) | ||
|
||
## 2. Setting the demo variables | ||
To start the demo you must define 4 variables. In order to do that, open the `demo.py` file and edit the following: | ||
|
||
**The values below are just examples. You must set the variables according to your needs.** | ||
```python | ||
# The directory where the project will be saved | ||
working_directory = './' | ||
|
||
# The name you want for the project | ||
project = 'first_vame_project' | ||
|
||
# A list of paths to the videos file | ||
videos = ['./video-1.mp4'] | ||
|
||
# A list of paths to the poses estimations files. | ||
# Important: The name (without the extension) of the video file and the pose estimation file must be the same. E.g. `video-1.mp4` and `video-1.csv` | ||
poses_estimations = ['./video-1.csv'] | ||
``` | ||
|
||
## 3. Running the demo | ||
After setting the variables, you can run the demo by running the following code: | ||
|
||
```python | ||
python demo.py | ||
``` | ||
|
||
The demo will create a project folder in the working directory with the name you defined in the `project` variable and a date suffix, e.g: `first_name-May-9-2024`. | ||
|
||
In this folder you can find a config file called `config.yaml` where you can set the parameters for the VAME algorithm. The videos and poses estimations files will be copied to the project videos folder. If everything is ok, the workflow will run and the logs will be displayed in your terminal. The image below shows the VAME workflow. | ||
|
||
![demo workflow](/Images/vame-workflow-diagram.jpg) |
Oops, something went wrong.