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.26-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34c8758f6f595d8e08a5237376085e64ca2ff4a65249a6dd2dacb9cb2ad7b6cc |
|
MD5 | ebd0cbb4917e9ce364a61a8e2fd4a732 |
|
BLAKE2b-256 | b52ede8a66850f7dae31fb23aae69562b1e0a76e688d3c48112a1bd119b11ee2 |