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

Uploaded Source

Built Distribution

person_counter-1.1.7-py3-none-any.whl (145.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.7.tar.gz
  • Upload date:
  • Size: 107.2 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.7.tar.gz
Algorithm Hash digest
SHA256 27a866af8c54af26fe8bcfa2458400575440140d7690f2c60bfa83a5d5061ff3
MD5 b853fce723c19ed08ec3190bc0175537
BLAKE2b-256 10a245588f5c6ca52cdb49d6628f7aa8c14ca542c0a8931c2f53ea8a24d31d97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3d32cc1f7654ecae3f4031b4ca856bf28cdec93d1b7f48f27b262c719b39879f
MD5 a522079a6e9739a586b773cde9578e19
BLAKE2b-256 df2cc2097d816b342dd2fa0814e0aec7049c958b57975c10225568be73c6adfb

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