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

Uploaded Source

Built Distribution

person_counter-1.1.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.1.tar.gz
  • Upload date:
  • Size: 2.6 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.1.tar.gz
Algorithm Hash digest
SHA256 389d4b830b68ec19a67236f587123f94541c2e306746433983bcd85618735dbb
MD5 b0a38928a2d4ccf225f0d01a92c31e90
BLAKE2b-256 c13bfd4916b13fd5415e7ce0ad71768e097e7e98a977d6eb5205aa924bd8da5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90f0c8a1745e4435098e0586d10d585bd417ff0e92041b2f728f59b1821063aa
MD5 363d7b3a9aa702cf7134e12d90711aab
BLAKE2b-256 560e89d563da6a26ca2bf14b5c1307d436c7de35cf01faae6653a8f6e234aea7

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