Skip to main content

Simple object tracker

Reason this release was yanked:

WARNING: THIS VERSION OF NORFAIR IS OUT OF DATE AND HAS ERRORS, PLEASE UPDATE TO PYTHON>=3.7 TO GET THE LATEST VERSION

Project description

Norfair [ TODO: Mention in the intro ]

Norfair is a Python library for adding tracking to any detector. It aims at being easy to use, providing tools for creating your video tracking program using Norfair, while being modular enough to integrate only the parts of Norfair you need into an already existing program.

A typical use case would be any software alrady using a detector (such as object detection, instance segmentantion, pose estimation, etc) on video, seeking to easily add tracking to it. Another way we've seen it used is to speed up video inference, by only running the detector every x frames, and using Norfair to interpolate the detections on the skipped frames.

Usage overview

We know that using the latest SOTA detector usually requires running the code associated to a research paper, which sometimes means getting an eval script working as an inference script, and generally having to tweak a code base which wasn't built with modularity and ease of use in mind. Therefore we designed Norfair so that it could seamlessly plug in into this way of working with research projects.

Norfair consists of a set of tracking and video processing tools which are each designed to be usable on their own. You can create your video processing loop using just the tools Norfair provides, or plug parts of Norfair into your already existing video processing code.

A simple example of an all Norfair loop:

# Your detector
detector = SomeDetector()

# Norfair
video = Video(input_path="video.mp4")
tracker = Tracker(distance_function=distance_fn)

for frame in video:
    detections = detector(frame)
    detections = convert_fn(detections)
    tracked_objects = tracker.update(detections=detections)

    norfair.draw_tracked_objects(frame, tracked_objects)
    video.write(frame)

It isn't alway easy to extract a SOTA detector into a nice single detector object, so here is a simple example of plugging Norfair into a research repo:

### Find a good repo to use as a canonical Norfair demo

Installation

pip install norfair

API

Norfair provides a Video class to provide a simple and pythonic api to interact with video. It returns regular OpenCV frames which allows you to use the huge number of tools OpenCV provides to modify images.

You can get a simple video inference loop with just:

video = Video(input_path="video.mp4")
for frame in video:
    # Your modifications to the frame
    video.write(frame)

we think the api is a bit more pythonic than the standard OpenCV api, and it provides several nice ammenities such as an optional progress bar, and lets you not have to handle video formats, input validation, output file saving.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

norfair-0.1.4.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

norfair-0.1.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file norfair-0.1.4.tar.gz.

File metadata

  • Download URL: norfair-0.1.4.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.6.9 Linux/4.15.0-74-generic

File hashes

Hashes for norfair-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8400810718ed6a7afd99e2fa36b702c3c090a99ebe9143fe5c67e7ef2745f3b4
MD5 ca76c8bb37a0f3d28725f1b63592cd85
BLAKE2b-256 7be8346763b74f649e308380078d7431471cbb56edc56e3d01f64400694ab6f1

See more details on using hashes here.

File details

Details for the file norfair-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: norfair-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.6.9 Linux/4.15.0-74-generic

File hashes

Hashes for norfair-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ccb753a733e3a253c75770580aad59d72e7b1ca4300e075d899a74881d7c87c0
MD5 93c435f0cf385b0022c816315b272643
BLAKE2b-256 6399c1b3e7972d6b60ec443692f56887c0f16c5e2b5a508dae94857c49dc654f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page