{"id":46385182,"url":"https://github.com/centralelyon/ntt","last_synced_at":"2026-03-05T07:13:16.958Z","repository":{"id":163045187,"uuid":"623328958","full_name":"centralelyon/ntt","owner":"centralelyon","description":"Video and image processing tools.","archived":false,"fork":false,"pushed_at":"2026-02-25T15:10:08.000Z","size":115088,"stargazers_count":2,"open_issues_count":13,"forks_count":1,"subscribers_count":2,"default_branch":"dev","last_synced_at":"2026-02-25T16:42:32.228Z","etag":null,"topics":["image-processing","sports-analytics","video-processing","wrapper-library"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/ntt/","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/centralelyon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-04T06:44:37.000Z","updated_at":"2026-02-25T15:14:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b70e8994-1d91-4d0a-80a3-421b4fb6af89","html_url":"https://github.com/centralelyon/ntt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/centralelyon/ntt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralelyon%2Fntt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralelyon%2Fntt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralelyon%2Fntt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralelyon%2Fntt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/centralelyon","download_url":"https://codeload.github.com/centralelyon/ntt/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/centralelyon%2Fntt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30113302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["image-processing","sports-analytics","video-processing","wrapper-library"],"created_at":"2026-03-05T07:13:16.430Z","updated_at":"2026-03-05T07:13:16.945Z","avatar_url":"https://github.com/centralelyon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ntt\n\n[![CircleCI](https://dl.circleci.com/status-badge/img/gh/centralelyon/ntt/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/centralelyon/ntt/tree/main)\n[![Documentation Status](https://readthedocs.org/projects/ntt/badge/?version=latest)](https://ntt.readthedocs.io/en/latest/?badge=latest)\n\n`ntt` is a Python module that provides simple and consistent interfaces for common image and video processing tasks. It wraps around popular Python libraries to simplify their usage and make them interchangeable, to build complex pipelines. In particular:\n\n* [**Pillow**](https://python-pillow.org/) – image file handling\n* [**OpenCV**](https://opencv.org/) – computer vision, image and video processing\n* [**imageio**](https://imageio.github.io/) – read/write images and videos\n* [**scikit-image**](https://scikit-image.org/) – scientific image processing\n* [**NumPy**](https://numpy.org/) – arrays and calculations\n\n## Installation\n\n### Using `venv` (recommended)\n\n1. **Create a virtual environment:**\n\n```bash\npython -m venv venv\n```\n\n2. **Activate the environment:**\n\n* On macOS/Linux:\n\n```bash\nsource venv/bin/activate\n```\n* On Windows:\n\n```bash\nvenv\\Scripts\\activate\n```\n\n3. **Install the module:**\n\nThe module is available on [Pypi](https://pypi.org/project/ntt/):\n\n```bash\npip install ntt\n```\n\nOr install the development version from source:\n\n```bash\ngit clone\npip install -e .\n```\n\n## Tests\n\n```python\nimport ntt\nprint(ntt.__version__)  # Check the version\n```\n\nAssuming you have cloned the repository or installed the source package, you can run tests with `pytest`:\n\n```bash\n$ pytest tests\n```\n\n## Samples\n\nTo download the data samples (videos, images, sounds, etc.) used in tests and examples, clone the repository and update the `.env` file with the path to the cloned folder:\n\n```\ngit clone https://github.com/centralelyon/ntt-samples.git\n```\n\nAlternatively, you can generate fake videos samples by running the following script:\n\n```python\nfrom ntt.videos.video_generation import random_video\n\nvideo = random_video(320, 240, 10, 2)\n```\n\n## Building pipelines\n\nAn interesting use of `ntt` is to build complex pipelines for video and image processing. For that, we also built a separate tool, the [Pipeoptz](https://github.com/centralelyon/pipeoptz/) library, which provides a simple way to create and manage pipelines of functions.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://private-user-images.githubusercontent.com/586236/535009904-b224b218-e59a-4f8f-bcce-355e5de044ba.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NjgyOTY5MDAsIm5iZiI6MTc2ODI5NjYwMCwicGF0aCI6Ii81ODYyMzYvNTM1MDA5OTA0LWIyMjRiMjE4LWU1OWEtNGY4Zi1iY2NlLTM1NWU1ZGUwNDRiYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMTEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDExM1QwOTMwMDBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03OTIxOWVjNTVlNjM1Zjk4YTBmYmUzZDBmNWU3NWNkZmQzNWExYTMyODhmZTRjYzUxN2M3ZDcxMmFjM2U1NTQxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.f6z2CSZyAWEaf1RUk-wh4Ia6yEHNL7aQWqp0FEHTtr0\" width=\"50%\"\u003e\n\u003c/p\u003e\n\nThe image above is generated using the code below available as a [gist](https://gist.github.com/romsson/5e83ae6dbadf4175e3bbc1454a44a939).\n\n```python\nimport random\n\nfrom ntt.frames.frame_generation import random_frame\nfrom ntt.frames.display import display_frame\nfrom pipeoptz import Pipeline, Node\n\ndef random_number():\n    num = random.randint(100, 600)\n    return num\n\npipeline = Pipeline(\"Simple Pipeline\", \"Generate a random image.\")\n\nnode_gen_width = Node(\"GenWidth\", random_number) \nnode_gen_height = Node(\"GenHeight\", random_number)\nnode_random_frame = Node(\n    \"random_frame\", random_frame, fixed_params={\"width\": 10, \"height\": 3}\n)\n\npipeline.add_node(node_gen_width)\npipeline.add_node(node_gen_height)\npipeline.add_node(\n    node_random_frame, predecessors={\"width\": \"GenWidth\", \"height\": \"GenHeight\"}\n)\n\noutputs = pipeline.run()\ndisplay_frame(outputs[1][pipeline.static_order()[-1]])\n\n```\n\n## Examples\n\nYou may look at the `examples` folder to see how to use `ntt` functions. Also a look a the `tests` folder to see how functions are tested. And of course, the documentation at [https://ntt.readthedocs.io](https://ntt.readthedocs.io).\n\nAssuming you have a `crop.mp4 ` video in a `samples` folder and an `output`\nfolder, here is how to use `extract_first_frame` function.\n\n```python\nimport os\nfrom dotenv import load_dotenv\nfrom ntt.frames.frame_extraction import extract_first_frame\n\nif __name__ == \"__main__\":\n    load_dotenv()\n\n    output = extract_first_frame(\n        video_path_in=os.environ.get(\"NTT_SAMPLES_PATH\"),\n        video_name_in=\"crop.mp4\",\n        frame_path_out=os.environ.get(\"PATH_OUT\"),\n        frame_name_out=\"crop-ex.jpg\",\n    )\n\n    print(f\"Frame successfully extracted at {output}\") if output is not None else print(\n        \"Frame extraction failed\"\n    )\n```\n\n\n## CircleCI\n\nThe project is configured to run tests on CircleCI. The configuration file is\n`.circleci/config.yml`.\n\n## Docker\n\nA Dockerfile is provided to quickly set up an environment with all system dependencies (OpenCV, FFmpeg, etc.) and run tests or scripts.\n\n### Build the image\n\n```bash\ndocker build -t ntt .\n```\n\n### Run tests\n\nBy default, running the container executes the `pytest` test suite:\n\n```bash\n# Run tests using the code inside the container\ndocker run --rm ntt\n```\n\nDuring development, you can mount your local directory to run tests on your current code:\n\n```bash\n# Linux / macOS / Windows PowerShell\ndocker run --rm -v ${PWD}:/app ntt\n\n# Windows Command Prompt (cmd)\ndocker run --rm -v \"%cd%:/app\" ntt\n```\n\n### Run a custom script\n\nYou can override the default command to run a specific Python script:\n\n```bash\ndocker run --rm -v ${PWD}:/app ntt python tests/test_random_strings.py\n```\n\n### Run in interactive mode\n\nTo explore the container or run multiple commands manually, start a bash shell:\n\n```bash\ndocker run --rm -it -v ${PWD}:/app ntt bash\n```\n\n## Acknowledgments\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://liris.cnrs.fr/sites/default/files/logo_liris_160_0.png\" style=\"height:50px\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003cimg src=\"https://www.ec-lyon.fr/sites/default/files/styles/paragraph_image/public/content/paragraphs/images/2024-10/2024_logo-centrale-h_rouge_rvb.jpg.webp\" style=\"height:50px\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003cimg src=\"https://www.natation-handisport.org/wp-content/uploads/2021/10/logo_NePTUNE_color-768x204.png\" style=\"height:50px\"\u003e\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentralelyon%2Fntt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcentralelyon%2Fntt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcentralelyon%2Fntt/lists"}