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

Uploaded Source

Built Distribution

person_counter-1.1.8-py3-none-any.whl (145.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.8.tar.gz
  • Upload date:
  • Size: 107.2 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.8.tar.gz
Algorithm Hash digest
SHA256 d8d3bd4fa58a98b772d9e210fac355fe59e20624dd0e662f5d3e52de70461b54
MD5 2ac756e8a1a674341eb787aa1a762cfd
BLAKE2b-256 75e696834becc9c0357f39111e464414d11b9e2d382bd0d67cc5ddd2d3a6e8e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d24dea3a8630a87025cbb0663970c4fb92fcd3b0d8a63fb5dceff6da4b94159f
MD5 37d30362873dcd991da1dd1c123ae05d
BLAKE2b-256 bdfdec6e6b94e4510804185790f146af375f44e59eb4394df43c9e5625f227bc

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