A Python package for mouse path control and training.
Project description
Machine Learning Mouse Path
mlmp (Machine Learning Mouse Path) 是一个用于鼠标路径控制和训练的 Python 包,使用mlmp推理出的鼠标路径移动鼠标,让其看起来更像人类。它提供了鼠标路径预测功能,并支持通过数据收集和训练来自定义鼠标行为
功能
- 鼠标路径预测:基于预训练模型或自定义模型文件,预测鼠标路径。
- 数据收集:收集鼠标移动数据,用于训练自定义模型。
- 训练模型:使用收集的数据训练鼠标行为模型。
- 时间序列数据支持:支持时间序列数据的收集和训练(需启用开发功能)。
正处于开发阶段,功能随时可能发生变化
安装
通过 pip 安装 mlmp:
pip install mlmp
使用示例
鼠标路径预测
from mlmp import mouse
# 初始化鼠标对象
m = mouse()
# 预测鼠标路径
start = (0, 0)
end = (100, 100)
result = m.mouse_output(start, end)
print(result)
# 输出示例
[(0, 0), (6, 5), (11, 17), (17, 19), (21, 20), (14, 11), (11, 11), (5, 4), (4, 3), (3, 5), (8, 5)]
数据收集和训练
from mlmp import TrainBySelf
# 初始化训练器
trainer = TrainBySelf()
# 收集数据
trainer.collect_data()
# 训练数据是点击红色球后再点击一次蓝色球,视为一次数据收集,每轮最多记录100次
# 建议收集5轮次及以上的数据后,在开始训练
# 训练模型
# 将收集好的数据(mouse_data.csv)抽出一部分,放入(mouse_data_test.csv)
# 或重新收集1-2轮次,保证两个文件可访问
trainer.train()
# 训练完成后,会生成一个onnx模型文件
时间序列功能(开发功能)
from mlmp import TrainBySelf
# 初始化训练器并启用开发功能
trainer = TrainBySelf()
trainer.dev_features = True
# 收集时间序列数据
trainer.time_seq_mouse_data()
# 与之前方式相似,名字改为 mouse_data_time_seq.csv
# 训练集名字改为 mouse_data_time_seq_test.csv
# 训练时间序列模型
trainer.time_seq_train()
开发功能
时间序列数据收集和训练功能默认为关闭状态。如果需要使用,请在初始化 TrainBySelf 时启用开发功能:
trainer = TrainBySelf()
trainer.dev_features = True
依赖
onnxruntime:用于模型推理。
许可证
本项目基于 MIT 许可证发布。详情请参阅 LICENSE 文件。
项目主页
访问 GitHub 仓库 获取最新版本和源代码。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mlmp-0.1.0.tar.gz
(10.4 kB
view details)
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
mlmp-0.1.0-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file mlmp-0.1.0.tar.gz.
File metadata
- Download URL: mlmp-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63d87d5e571bee74fc48d5af2afa924c3a46d4578ced253dfd848cbb9e07f00a
|
|
| MD5 |
b2a09c1d40c5b777a3181f48f8a0129c
|
|
| BLAKE2b-256 |
8ffd994f126c7694f2ab3984976a5778f5df8dcf8477c2b059a94cfc273de92a
|
File details
Details for the file mlmp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mlmp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebaa639d8ea6bcfd674656374938ee406c7b272eeaa36b0dd2fd1c46b5dd9c71
|
|
| MD5 |
14c7a7178f865b7bba28bdc2d8cf61f0
|
|
| BLAKE2b-256 |
e378ee4390441be21971db5ae57753397c1ba6b6ca404a02bc7560d6b1213408
|