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.27.tar.gz (108.8 kB view details)

Uploaded Source

Built Distribution

person_counter-1.1.27-py3-none-any.whl (147.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.27.tar.gz
  • Upload date:
  • Size: 108.8 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.27.tar.gz
Algorithm Hash digest
SHA256 3b4b2bcb2e8b4d361ed7b23840f1bdec94e14b443d140d7c4a57a20ae37f1db3
MD5 4b4915fca586b4da5cf7c3a6f093f7d6
BLAKE2b-256 d2b5a48f2d245a451ae4cc9a689cba89fa80078b5967ada86587e9af9feda5f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.27-py3-none-any.whl
Algorithm Hash digest
SHA256 39227945003381671df6afd67a8494ee434849a0b084f6266ee423eb665f129b
MD5 7a97ca8c5a24ae358267a8686e61c9f6
BLAKE2b-256 88a71005f9d2c594a161b5cd0aaab8b4bf0c9f73eb4959be7d29dd776cc05a72

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