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

Uploaded Source

Built Distribution

person_counter-1.1.11-py3-none-any.whl (146.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.11.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.11.tar.gz
Algorithm Hash digest
SHA256 14a63807927dc2919ed5d97bd40c21dd2f8c8f39adfdc4385e5e6a48fdda96f6
MD5 64e891fc5d771970c9ed8155363d4880
BLAKE2b-256 5f9f411bdf236b2acb426260e0d208529737331226090b73f4c1ee8b815836a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 6665456dec6acacc96b1037e734a563b8a1c435f33f5d1954d5382e836ed814d
MD5 28efcaa1cc49d18d8ea59f911a66c054
BLAKE2b-256 ff8f657c3cbf8a5b13a57dbf3b2eb873338f727abd83309413af83cb3ec014dc

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