Name | person-counter JSON |
Version |
1.1.30
JSON |
| download |
home_page | |
Summary | Person Counter using torch |
upload_time | 2022-12-27 13:53:27 |
maintainer | |
docs_url | None |
author | Olivier |
requires_python | |
license | |
keywords |
python
person
counting
ai
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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()
Raw data
{
"_id": null,
"home_page": "",
"name": "person-counter",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,person,counting,AI",
"author": "Olivier",
"author_email": "luowensheng2018@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d3/f2/ccc94a07615c188ff3e3548777a34ed08b64de0c38c035af0140a303dd74/person_counter-1.1.30.tar.gz",
"platform": null,
"description": "\r\n# Person counter\r\n\r\n\r\n\r\nfrom opencv_stream import VideoStreamer, FpsDrawer\r\nfrom person_counter.model import PersonCounterModel, PersonCounterOutput\r\nimport numpy as np\r\nimport os\r\n\r\nVIDEO_DIR = \"D:/project/facebodydetection/facebodydetect/app/src/videos\"\r\ndef get_video():\r\n paths = [ os.path.join(VIDEO_DIR, p) for p in os.listdir(VIDEO_DIR)]\r\n return np.random.choice(paths)\r\n\r\n\r\n\r\nstream = VideoStreamer.from_video_input(get_video())\r\nfps = FpsDrawer()\r\n\r\nmodel = PersonCounterModel()\r\n\r\n\r\n@stream.on_next_frame()\r\ndef index(frame: np.ndarray):\r\n \r\n result = model.predict(frame) \r\n\r\n if result.is_ok():\r\n output: PersonCounterOutput = result.unwrap()\r\n output.draw(frame)\r\n else:\r\n raise result.exception\r\n\r\n fps.draw(frame)\r\n\r\n\r\nstream.start()\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Person Counter using torch",
"version": "1.1.30",
"split_keywords": [
"python",
"person",
"counting",
"ai"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "0721be7f9f7faf0a23ef7a861fe2eafb",
"sha256": "c2aad5fce2eca6c6dd78212f013dac5567521fa16604c6ff510c4b94ec7f60ad"
},
"downloads": -1,
"filename": "person_counter-1.1.30-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0721be7f9f7faf0a23ef7a861fe2eafb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 147591,
"upload_time": "2022-12-27T13:53:25",
"upload_time_iso_8601": "2022-12-27T13:53:25.427950Z",
"url": "https://files.pythonhosted.org/packages/cf/25/c8374ad28273c2714381f4adc37a0c10ad0b44321c0645616cb897f929f4/person_counter-1.1.30-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "176e6ce0494532e2e4390433f60208f6",
"sha256": "28b022aa229f8cffccfad4468a4433757f52b0a76835215e02a84f0e44bb68fd"
},
"downloads": -1,
"filename": "person_counter-1.1.30.tar.gz",
"has_sig": false,
"md5_digest": "176e6ce0494532e2e4390433f60208f6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 108867,
"upload_time": "2022-12-27T13:53:27",
"upload_time_iso_8601": "2022-12-27T13:53:27.094275Z",
"url": "https://files.pythonhosted.org/packages/d3/f2/ccc94a07615c188ff3e3548777a34ed08b64de0c38c035af0140a303dd74/person_counter-1.1.30.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-27 13:53:27",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "person-counter"
}