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

Uploaded Source

Built Distribution

person_counter-1.1.19-py3-none-any.whl (145.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.19.tar.gz
  • Upload date:
  • Size: 107.3 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.19.tar.gz
Algorithm Hash digest
SHA256 a5a4627898bab676fdb2a206779cbdf21d52ee238c8f3a09e2698b9cf293d174
MD5 7c453fab686b5edb350649da02a65691
BLAKE2b-256 b9731080a7fd5ce9c022b4a15ddc6b5e3631ebcf041b2efab00bb916d016b2f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 eda214ab319a8eb6e33f091e65e15241ac60e9e9496e3f99cf2065b71b1c5876
MD5 330d9c0d70a5b670b0b0a8b39feca4f7
BLAKE2b-256 e9f8fc511b1c09074193d2f5e8e249a74d710f11f2b972e8b9e750a2e57ae7a1

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