Skip to content

Commit 44c4b10

Browse files
- Move video_cutter in a standalone package
- Changed build system
1 parent f32c208 commit 44c4b10

File tree

4 files changed

+5
-612
lines changed

4 files changed

+5
-612
lines changed

README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,7 @@ To use the notebooks, two options :
4444
- Use Jupyter directly in its web browser interface : from the terminal, activate the conda environment : `conda activate ffd`, then launch Jupyter : `jupyter lab /path/to/the/notebooks/notebook.ipynb`
4545

4646
## Using the video_cutter script
47-
This script (`/scripts/video_cutter.py`) is used to cut long recording containing multiple stimulations into single-stimulation clips.
48-
49-
It uses the video file and a corresponding stimulation trace stored as a text or binary file.
50-
51-
To use it, first install required dependencies following steps 1-5 in the [Quick start](#quick-start) section.
52-
Then, you need to install ffmpeg on your system. If it is not the case already you can follow this for Windows :
53-
1. Download the latest "essential" build from [here](https://www.gyan.dev/ffmpeg/builds/). Unzip it somewhere relevant (in a "Programs" directory or something), and copy the path to the `bin` folder (making sure it contains both 'ffmpeg.exe' and 'ffprobe.exe').
54-
2. Paste this path in the `FFMPEG_BIN_DIR` variable. In the event ffmpeg is added to your PATH (eg. `ffmpeg` is recognised in a terminal), you can leave `FFMPEG_BIN_DIR` set to an empty string (`""`).
55-
3. Fill in the parameters according to your need.
56-
3. From the terminal with the ffd environment activated, browse to the script location :
57-
```bash
58-
conda activate ffd
59-
cd path/to/features-from-dlc/scripts/
60-
```
61-
62-
And run the script on your videos :
63-
```bash
64-
python video_cutter.py path/to/your/videos
65-
```
66-
67-
The script is built as a command line interface (cli), for detailed usage, use :
68-
```bash
69-
python video_cutter --help
70-
```
71-
72-
The script processes all videos found in the input directory that have a txt/csv/bin file with the same name. The latter is read to determine the stimulation onsets. Extracted clips are created in {video-name}-cropped folder and are numbered from 0 to the number of stimulations found in the stimulation file.
47+
This moved in a standalone package, see [here](https://github.com/TeamNCMC/videocutter).
7348

7449
### Notes
7550
- The format of txt files exported from Labscribe depends on its version... Sometimes the values are separated by commas (`,`), sometimes tabulations. To be sure, open the file with a text editor and see if there are "," or big spaces between values on a row. Edit the `SEP` parameter accordingly in the script.

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "features-from-dlc"
3-
version = "2024.12.12"
3+
version = "2024.12.17"
44
authors = [{ name = "Guillaume Le Goc", email = "g.legoc@posteo.org" }]
55
description = "Behavioral quantification from DeepLabCut tracking"
66
readme = "README.md"
@@ -27,15 +27,14 @@ dependencies = [
2727
"shapely>=2.0.4",
2828
"tables>=3.10.1",
2929
"tqdm",
30-
"typer",
3130
]
3231

3332
[project.urls]
3433
"Source Code" = "https://github.com/TeamNCMC/features-from-dlc"
3534

3635
[build-system]
37-
requires = ["setuptools", "wheel"]
38-
build-backend = "setuptools.build_meta"
36+
requires = ["hatchling"]
37+
build-backend = "hatchling.build"
3938

4039
[tool.ruff]
4140
line-length = 88

scripts/ffd_quantify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Specify each entry, reading carefully what they do, then run the script with the 'ffd'
55
conda environment activated.
66
7-
Works with features_from_dlc v2024.12.12
7+
Works with features_from_dlc v2024.12.17
88
99
"""
1010

0 commit comments

Comments
 (0)