Skip to content

centralelyon/ntt

Repository files navigation

ntt

CircleCI Documentation Status

A modular video processing pipeline

Quick install from GitHub

pip install git+https://github.com/centralelyon/ntt.git@main

Editable install for development

To develop "ntt" library, make an editable install inside a Python virtual environment using pip -e editable flag.

  1. create a virtual environment and activate it
  2. clone this ntt repository
  3. install ntt and its "dev" dependencies
pip install -e ".[dev]"

In case of important changes (e.g repository structure), you may have to install the library again.

Tests

Assuming you have cloned the repository or installed the source package, you can run tests with pytest:

$ pytest tests

Examples

Look at the examples folder to see how to use ntt functions.

Assuming you have a crop.mp4  video in a samples folder and an output folder, here is how to use extract_first_frame function.

from ntt.frames.frame_extraction import extract_first_frame

if __name__ == "__main__":
    extract_first_frame(
        video_path_in="samples/",
        video_name_in="crop.mp4",
        frame_path_out="output/",
        frame_name_out="crop-ex.jpg",
    )

Repository structure

.
├── .circleci: configuration for CircleCI
│   ├── config.yml
│   └── ...
├── examples: simple examples on how to use ntt functions
│   ├── (files)
│   └── ...
├── samples: sample videos, images and data
│   ├── (files)
│   └── ...
├── src: the package source code
│   └── ntt: the main module
│       ├── README.md
│       ├── __init__.py
│       ├── frames: module for frame extraction
│       │   └── ...
│       ├── ...
│       └── ...
├── tests: pytest files
│   ├── (files)
│   └── ...
├── .gitignore
├── Dockerfile
├── README.md
├── pyproject.toml: ntt Python packaging file, contains ntt dependencies
├── requirements.txt
└──

Module structure

Each module structure is as follows:

.
├── ...
├── ntt/
│   ├── __init__.py
│   ├── README.md
│   ├── name_of_the_module/
│   │   ├── __init__.py
│   │   ├── README.md
│   │   ├── name_of_the_function1.py
│   │   ├── name_of_the_function2.py
│   │   └── ...
│   ├── ...
│   └── ...
└── ...

CircleCI

The project is configured to run tests on CircleCI. The configuration file is .circleci/config.yml.

Docker

Steps

  • build the image

docker build -t ntt .

$ docker build -t ntt .

Linux/Unix/Mac

  • run the image

docker run --rm -v ${PWD}:/app ntt

(rm is to remove the container after it is stopped)

docker ps -a

(shows the list of containers)

  • run a custom script

docker run --rm -v ${PWD}:/app ntt python ntt/frames/test/test_frame_extraction.py

Windows

  • run the image

docker run -v "$(pwd)":/app ntt python ntt/frames/test/test_frame_extraction.py

Acknowledgments

      

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages