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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.24.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.24.tar.gz
Algorithm Hash digest
SHA256 438c88260b5835824bbbe73c1f7c5724be4522313daf2efdcccf02eb4e2dbb99
MD5 b2b65063505a4be6b45a00899772a523
BLAKE2b-256 b6733499bb24b6086f2ae6887a37e693dd521aad8bf59fdce082648fd1aa83e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 a8905ff28fc3d8e4ec305193fb8350d28ce2fb4c6c1797acf53d0a176c88021c
MD5 1c20e3e1079f2acbda872c16a57cafd4
BLAKE2b-256 b080bec9fa82cfe29242bf4f40fecd97375f14db53434f777cb4c81b477d0fe3

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