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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.23.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.23.tar.gz
Algorithm Hash digest
SHA256 8fbe70219ea9453d994f80f0462776d40568a01c495a577d62ec36b5b6c2739b
MD5 8173b6e3727e3b42b4e6a639200933ed
BLAKE2b-256 ba7334721aa17d5a3d16375198c2293b7b5fcc1fa81e72dec47ab51de6e7580a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 42accd77513e0110e0708e6a292ff02182dbe3ae6b8fe66b2cf446967b31c107
MD5 b5e0cc10ba7e0364fa7f38d11dfeb972
BLAKE2b-256 22959764eac9f05942e89262caffdfb5de610f4c68222dcea33065ef132b308e

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