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

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.1.tar.gz (27.7 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.1-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mlmp-0.1.1.tar.gz
  • Upload date:
  • Size: 27.7 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.1.tar.gz
Algorithm Hash digest
SHA256 ff43506124143f0836703690f725fad64b776a7bf4108685b4a3579602424b9f
MD5 2391a3a752586101c61798beeb9c1a00
BLAKE2b-256 371d7af5bc0425f0bb9af84fe3fa0226786d93492acf2c5fa25851ed0d286d31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mlmp-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f17c577f874d0dc6e46abf9e1e5d55706f8269f343d8f43243337f534a3dd91
MD5 c231dc9d492d9c073552e0469ee5461c
BLAKE2b-256 0b3e720c7f76fa5f8bd6827fc308e59c834e16b131bdf78ecc9a38b2961ea118

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