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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f12ccdfefaa3973b7f04ffc28e16e905bf96d5062dea39fb58818b0b23d890c5
MD5 183a40c438678a8a546e917fdc724f55
BLAKE2b-256 d9c3c938d00312858d5604f9158cdf4b1d8f3a2a4041b91e0469e68af710c07c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c25e0a1348df2065e8987620ea7facd1cbea24431b606edff9c70841e8ffcd6f
MD5 a220293c58d5f8a4736c436aea23e8b6
BLAKE2b-256 bc5d2da8635fbab6fb2875578e01af9d403de3785e30b39ad2fb8c12ff6b496f

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