Skip to main content

Person Counter using torch

Project description

Person counter

from opencv_stream import VideoStreamer, FpsDrawer from person_counter.model import PersonCounterModel, PersonCounterOutput import numpy as np import os

VIDEO_DIR = "D:/project/facebodydetection/facebodydetect/app/src/videos" def get_video(): paths = [ os.path.join(VIDEO_DIR, p) for p in os.listdir(VIDEO_DIR)] return np.random.choice(paths)

stream = VideoStreamer.from_video_input(get_video()) fps = FpsDrawer()

model = PersonCounterModel()

@stream.on_next_frame() def index(frame: np.ndarray):

result = model.predict(frame)

if result.is_ok(): output: PersonCounterOutput = result.unwrap() output.draw(frame) else: raise result.exception

fps.draw(frame)

stream.start()

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

person_counter-1.1.22.tar.gz (108.1 kB view details)

Uploaded Source

Built Distribution

person_counter-1.1.22-py3-none-any.whl (146.6 kB view details)

Uploaded Python 3

File details

Details for the file person_counter-1.1.22.tar.gz.

File metadata

  • Download URL: person_counter-1.1.22.tar.gz
  • Upload date:
  • Size: 108.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for person_counter-1.1.22.tar.gz
Algorithm Hash digest
SHA256 2421054aa9e5a9626660234535b5f01f77ff113a23e8c53bccee85dc308c7ae0
MD5 64d9b78db34fe6ac2af23d514f253eb1
BLAKE2b-256 1d5b168b2dec517dfd0d15f3c5fabdf0fe7c7b4a3d47171610d9c0b9061d30c7

See more details on using hashes here.

File details

Details for the file person_counter-1.1.22-py3-none-any.whl.

File metadata

File hashes

Hashes for person_counter-1.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 85d9b15fcabeab7685c27b63c244ad1b6d11b2efae95a2529410f35377c75121
MD5 266aee19f3d311f4f3ad1ef9d5b6949b
BLAKE2b-256 fa779e3ce50b00854a896d82b4bce3d8a19232328743c10d3c4f742ba02cf8c7

See more details on using hashes here.

Supported by

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