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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.20.tar.gz
  • Upload date:
  • Size: 108.0 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.20.tar.gz
Algorithm Hash digest
SHA256 b35a658b327c24684c50ba76501d2c5979fdb6a2ae6c4e9e7548f97a27772ae9
MD5 3e96403194ff44abdfcd259ab0020415
BLAKE2b-256 704e620e2100440a0e37e38c17c33c1e076be79bf65aa38eaffe983c9bb9a57d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 4afe7df1dc18f626b9cee9ed00c08a0e801d225f93375f3d43e72bfe766cd3b6
MD5 8de091915180d9373b2ecbdc1dbe232f
BLAKE2b-256 e2a8295e5556285e44edcf5dc686d70433daddb460e9e0b504b020c714e935e6

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