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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file person_counter-1.1.30.tar.gz.
File metadata
- Download URL: person_counter-1.1.30.tar.gz
- Upload date:
- Size: 108.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28b022aa229f8cffccfad4468a4433757f52b0a76835215e02a84f0e44bb68fd
|
|
| MD5 |
176e6ce0494532e2e4390433f60208f6
|
|
| BLAKE2b-256 |
d3f2ccc94a07615c188ff3e3548777a34ed08b64de0c38c035af0140a303dd74
|
File details
Details for the file person_counter-1.1.30-py3-none-any.whl.
File metadata
- Download URL: person_counter-1.1.30-py3-none-any.whl
- Upload date:
- Size: 147.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2aad5fce2eca6c6dd78212f013dac5567521fa16604c6ff510c4b94ec7f60ad
|
|
| MD5 |
0721be7f9f7faf0a23ef7a861fe2eafb
|
|
| BLAKE2b-256 |
cf25c8374ad28273c2714381f4adc37a0c10ad0b44321c0645616cb897f929f4
|