Skip to main content

detective:一款更适合中国宝宝的室友内卷监测工具

Deploy MkDocs site to GitHub Pages (using mkdocs gh-deploy) CI Tests PyPI version GitHub license

介绍

detective是一款更适合中国宝宝的室友内卷监测工具,它可以帮助你监测室友的内卷行为,让你的寝室生活更加和谐。

TODO:demo

环境要求

环境 版本
OS Ubuntu22.04, Raspberry Pi OS, Window11, Debian 12
Python 3.10

硬件清单

  • Raspberry Pi 4B * 2
  • 摄像头 * 2
  • 蜂鸣器
  • LED灯
  • 面包板

安装

pip安装

pip install detective-pi

源码安装

克隆仓库

git clone https://github.com/sergiudm/detective.git
cd detective

你可以使用deploy.sh脚本自动安装

sudo chmod +x deploy.sh
./deploy.sh

或者手动安装

conda create -n <your_env_name> python=3.10
conda activate <your_env_name>
pip install -r requirements.txt

使用说明

开始前,你需要配置config.json文件, 以下是一个示例:

{
    "use_pi": false,
    "plugin_list": [
        "information_server",
        "GPIO_controller",
        "music_server",
        "gpio_controller",
        "gesture_detection",
        "relax_detect"
    ], # 注意:涉及GPIO的插件要开启`use_pi`,如果不使用GPIO相关的库则关闭
    "default_detect_mode": "others",
    "use_camera": true,
    "LED_pin": 18, # LED灯的引脚
    "use_visualization": false, # 是否使用可视化
    "server_email": "youremail@example.com",
    "server_email_password": "your email password",# 请使用授权码
    "target_email": [
        "email1",
        "email2"
    ],
    "smtp_server":"your smtp server",
    "smtp_port": 587,
    "video_path": "assets/videos/sit.mp4", # use_camera为false时,使用该视频
    "image_path": "resources", # 邮件中的图片
    "send_delay": 13,
    "effective_detection_duration": 2,
    "max_num_hands": 2,
    "min_detection_confidence": 0.65,
    "min_tracking_confidence": 0.65,
    "pin_data": {
        "pin_list": [
            17,
            23,
            24,
            25,
            27
        ],
        "pin_map": {
            "Right": [
                17,
                23,
                24
            ],
            "Return": [
                23,
                24
            ],
            "Left": [
                17,
                24
            ],
            "Pause": [],
            "Like": [
                25
            ],
            "OK": [
                27
            ]
        }
    }
}

[!CAUTION] 实际使用时,请删除config.json中的所有注释!

Linux:

sudo chmod +x run.sh
./run.sh

Windows:

win_run.bat

功能

  • 检测是否有室友在内卷
    • 如果有,会自动响起警报,并且发微信通知你
  • 检测你是不是卷过头了
    • 如果连续工作超过2小时(可在config.json中配置),会自动响起警报,并提醒你休息一下
  • to do list
    • 检测 学习 与 玩游戏
      • 肩部、髋部、膝盖 夹角; 手部 位置
    • 报警:蜂鸣器(可换为便宜的喇叭)(直到结束学习才消失)、led、微信发消息
    • 开关门检测
      • 开关门 检测完成后: 人在寝室,才监控
    • 不良坐姿的检测
    • 魔术

如何贡献

本仓库仅使用了mediapipe中的人体姿态检测和手部检测功能,如果你有更多想法,欢迎:

  • 提交PR
  • 提交Issue
  • 传播给更多的室友

Acknowledgement

mediapipe

Metadata

Release files for detective-pi 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for detective-pi 0.2.0
File Size Uploaded Provenance Actions
detective_pi-0.2.0.tar.gz 21.8 kB Without provenance Details for detective_pi-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for detective-pi 0.2.0
File Interpreter ABI Platform Actions
detective_pi-0.2.0-py3-none-any.whl Python 3 none any Details for detective_pi-0.2.0-py3-none-any.whl

Total release size: 47.8 kB

Release files / detective_pi-0.2.0.tar.gz

Download URL detective_pi-0.2.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e33138d3e98e619bb41b654cdde7142005c023e8d46d76455b10347a5576884
BLAKE2b-256 checksum
How to use checksums
ed0a743435561c90c458ebd92d67c45816d1d95bd4b7072a0a25e99562b58a55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.15

Release files / detective_pi-0.2.0-py3-none-any.whl

Download URL detective_pi-0.2.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b79fd241959d86da0df93f079dae8977567f95261d2ce748bf72ec6966a206b4
BLAKE2b-256 checksum
How to use checksums
65088c7a7d93576aab6326b2e464d29185e03e510619691e8bad2f8f45b9e6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.15

Security for detective-pi 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page