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

Uploaded Source

Built Distribution

person_counter-1.1.14-py3-none-any.whl (145.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.14.tar.gz
  • Upload date:
  • Size: 107.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.14.tar.gz
Algorithm Hash digest
SHA256 cd8f9ce91cb90dbaf48562dbe807e14a06dae005668a483f70b5a8130c80a3ee
MD5 4882e08cc780a0e08c5f0fe1caf84540
BLAKE2b-256 c1c6460015193a84698099cbee5b5a3a510a4f67e843a348fb3e6b8421ec51f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7367838ca8fce87c7c9a5a6e9f0724303f05dc06588c9cf2c7dc86d1d9a147
MD5 7855aa440b220fa7b91a55b2e71cc63f
BLAKE2b-256 af837733682843c032ac8040696872cc36797d216bd309333c87467386ae6d54

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