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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for person_counter-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90f0c8a1745e4435098e0586d10d585bd417ff0e92041b2f728f59b1821063aa |
|
MD5 | 363d7b3a9aa702cf7134e12d90711aab |
|
BLAKE2b-256 | 560e89d563da6a26ca2bf14b5c1307d436c7de35cf01faae6653a8f6e234aea7 |