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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: person_counter-1.1.9.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.9.tar.gz
Algorithm Hash digest
SHA256 d2ac12e7b00f56c799a1d39a192c57f3b9ce327e26f6483ba674cfeb90030957
MD5 07fec9520261c978b97fee332201083f
BLAKE2b-256 b07c8470b0e0ba1dd09eadfde7a6a88f26dacadbb6cbef35b3db23a186f92bc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for person_counter-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 524279545f2cf8875fdd580a0cbe4f24ba378063d11dceb39c8768fcf46e7757
MD5 8301f4d56348af29612ab4bf27f620f1
BLAKE2b-256 04b457975828ae9787f755931d8a18048df17b6880df42da43b13c4d4e6231df

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