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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.10.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.10.tar.gz
Algorithm Hash digest
SHA256 cbbe13a44d87d55d7f93fc38087230b403496080de64e1b44746bab89430a3ba
MD5 f0222309aa77f1efd0209d3364afa97c
BLAKE2b-256 82be8b68a9b331967b7872da97d1c7b96dfa6a8acf0445dbc834486bf91d174b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 07340a5a6ce1225d5a0edfd302c4b4cbb8577e226cc90cdec7682053a1c93cc2
MD5 a644b606ed5b06e801183cf42403e9c8
BLAKE2b-256 bdd60e5f293dbc72cf6e666fc3f00d86d1b48930e02c27433c3b6cf15793054b

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