Skip to main content

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 仓库 获取最新版本和源代码。

致谢

本项目的部分代码借鉴了 suixin1424/mouse_control 的实现

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.2.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlmp-0.1.2-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file mlmp-0.1.2.tar.gz.

File metadata

  • Download URL: mlmp-0.1.2.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for mlmp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8869f889d3cece589c9990ddb248cf179a51d711185e90fd1222490e6dae3465
MD5 261aa083e59f567fc58371d578422c80
BLAKE2b-256 45a834671d485f64016bbdf77a3060f08883dd85d3af4e80d250c6ad01394f3b

See more details on using hashes here.

File details

Details for the file mlmp-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mlmp-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for mlmp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f08118d7058e19f9b84eaaf3a3f5c8c3295bfeb67ae4b98ae2c39d6f537039d
MD5 28ca5547673d96b8b5d6f2245384921e
BLAKE2b-256 163998e6dd6840cd5df9c245da46ca4f6edd18951f528fa0902ffb4238ab6a98

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page