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

Uploaded Source

Built Distribution

person_counter-1.1.3-py3-none-any.whl (117.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.3.tar.gz
  • Upload date:
  • Size: 82.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.3.tar.gz
Algorithm Hash digest
SHA256 51fcf309db797574d1bda5ca4119dde02819f588f6e7ac3222ad497779c9349a
MD5 45c0d18a2667c05f2256a595549754cb
BLAKE2b-256 bb6caba8299d41dec15c68fbe0c5c57c302c44dafdbc274ec28bbabecc26838e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 23fff2b2a40e2ddd321c91c3dba152cf06a2f6e2f6ac0547dfa21bd212caf3dc
MD5 66b911b0acef2e08ddd785d54b90baae
BLAKE2b-256 3111698142c81d853b9bb33e5b978017c92a08c5127bf4e8ebc33a34080917ec

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