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

Uploaded Source

Built Distribution

person_counter-1.1.25-py3-none-any.whl (147.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.25.tar.gz
  • Upload date:
  • Size: 108.4 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.25.tar.gz
Algorithm Hash digest
SHA256 3859810b6542772d3661c29a0a393b3c0677839a55243829d1f0cc1af1fa386b
MD5 bde8607cbd20f060a2a2ecc1e8174f70
BLAKE2b-256 33a72fa830e73a4125f5c1d7d3387a6859f5c7e43b99c385393cc0fed7dcfc13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.25-py3-none-any.whl
Algorithm Hash digest
SHA256 11e0ad9e1313bdf4077e20ead0513a14c5fb03a7633bd7a5d24ebcdf72fa4e00
MD5 6d8618ceb2f30d2c8e4c40833bd3c514
BLAKE2b-256 1bfc4d520869b485489383942b6ab9d941935239dd46991b92ddb59a5907d519

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