OBS Plugin YOLO AI

{
    "DesktopAudioDevice1": {
        "prev_ver": 520093696,
        "name": "桌面音频",
        "uuid": "9697ce9f-1f93-411f-9fb7-b57b1b3e792d",
        "id": "wasapi_output_capture",
        "versioned_id": "wasapi_output_capture",
        "settings": {
            "device_id": "default"
        },
        "mixers": 255,
        "sync": 0,
        "flags": 0,
        "volume": 1.0,
        "balance": 0.5,
        "enabled": true,
        "muted": false,
        "push-to-mute": false,
        "push-to-mute-delay": 0,
        "push-to-talk": false,
        "push-to-talk-delay": 0,
        "hotkeys": {
            "libobs.mute": [],
            "libobs.unmute": [],
            "libobs.push-to-mute": [],
            "libobs.push-to-talk": []
        },
        "deinterlace_mode": 0,
        "deinterlace_field_order": 0,
        "monitoring_type": 0,
        "private_settings": {}
    },
    "current_scene": "场景",
    "current_program_scene": "场景",
    "scene_order": [
        {
            "name": "场景"
        }
    ],
    "name": "未命名",
    "sources": [
        {
            "prev_ver": 520093696,
            "name": "场景",
            "uuid": "0db1c08c-2c57-4c43-aabc-4dba4ec2f8f1",
            "id": "scene",
            "versioned_id": "scene",
            "settings": {
                "id_counter": 1,
                "custom_size": false,
                "items": [
                    {
                        "name": "显示器采集",
                        "source_uuid": "ea09c518-5fca-4868-8c65-6ac188eab8bb",
                        "visible": true,
                        "locked": true,
                        "rot": 0.0,
                        "scale_ref": {
                            "x": 1920.0,
                            "y": 1080.0
                        },
                        "align": 5,
                        "bounds_type": 0,
                        "bounds_align": 0,
                        "bounds_crop": false,
                        "crop_left": 0,
                        "crop_top": 0,
                        "crop_right": 0,
                        "crop_bottom": 0,
                        "id": 1,
                        "group_item_backup": false,
                        "pos": {
                            "x": 0.0,
                            "y": 0.0
                        },
                        "scale": {
                            "x": 1.0,
                            "y": 1.0
                        },
                        "bounds": {
                            "x": 0.0,
                            "y": 0.0
                        },
                        "scale_filter": "disable",
                        "blend_method": "default",
                        "blend_type": "normal",
                        "show_transition": {
                            "duration": 0
                        },
                        "hide_transition": {
                            "duration": 0
                        },
                        "private_settings": {}
                    }
                ]
            },
            "mixers": 0,
            "sync": 0,
            "flags": 0,
            "volume": 1.0,
            "balance": 0.5,
            "enabled": true,
            "muted": false,
            "push-to-mute": false,
            "push-to-mute-delay": 0,
            "push-to-talk": false,
            "push-to-talk-delay": 0,
            "hotkeys": {
                "OBSBasic.SelectScene": [],
                "libobs.show_scene_item.1": [],
                "libobs.hide_scene_item.1": []
            },
            "deinterlace_mode": 0,
            "deinterlace_field_order": 0,
            "monitoring_type": 0,
            "private_settings": {
                "show_in_multiview": true
            }
        },
        {
            "prev_ver": 520093696,
            "name": "显示器采集",
            "uuid": "ea09c518-5fca-4868-8c65-6ac188eab8bb",
            "id": "monitor_capture",
            "versioned_id": "monitor_capture",
            "settings": {
                "method": 1,
                "monitor_id": "\\\\?\\DISPLAY#AOC2702#7&185b7089&1&UID264#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}"
            },
            "mixers": 0,
            "sync": 0,
            "flags": 0,
            "volume": 1.0,
            "balance": 0.5,
            "enabled": true,
            "muted": false,
            "push-to-mute": false,
            "push-to-mute-delay": 0,
            "push-to-talk": false,
            "push-to-talk-delay": 0,
            "hotkeys": {},
            "deinterlace_mode": 0,
            "deinterlace_field_order": 0,
            "monitoring_type": 0,
            "private_settings": {},
            "filters": [
                {
                    "prev_ver": 520093696,
                    "name": "obs plugin",
                    "uuid": "a2d0694b-bea8-4750-a847-a3f6feab810c",
                    "id": "obs plugin",
                    "versioned_id": "obs plugin",
                    "settings": {
                        "mouse_move_method": 1,
                        "inference_method": 1,
                        "show_detection_window": false,
                        "rifle_aim_key_value": 1,
                        "rifle_aim_key_value2": 2,
                        "first_part": 0,
                        "recoil_key_value": 2,
                        "weapon_icon_recognition_mode": 0,
                        "include_head": 0,
                        "screenshot_mode": 0,
                        "sniper_aim_key_value": 27,
                        "sniper_automatic_fire_delay": 0,
                        "kmbox_vid_pid": "66882021",
                        "lead_gear": 0,
                        "weights_path": "C:/VP/VP/bin/64bit/model/wazs.onnx",
                        "movement_shake_degree": 0.0,
                        "conf_threshold": 0.45000000000000001,
                        "cpu_threads": 4,
                        "game_sensitivity": 1.0,
                        "mouse_single_movement_distance": 1,
                        "maximum_lead": 0,
                        "game_rotation_pixel_count": 2084,
                        "rotation_measurement_sensitivity": 1.0,
                        "rifle_delay_compensation_time": 16,
                        "rifle_aim_mode": 1,
                        "rifle_automatic_fire_interval": 200,
                        "rifle_aim_pixel_range": 60,
                        "rifle_aim_position_upper_limit": 1,
                        "rifle_aim_position_lower_limit": 1,
                        "rifle_aim_position_horizontal_limit": 1,
                        "rifle_static_aim_speed": 1.4499996900558472,
                        "rifle_movement_tracking_speed": 0.14499996602535248,
                        "sniper_delay_compensation_time": 16,
                        "sniper_aim_mode": 1,
                        "sniper_automatic_fire_interval": 400,
                        "sniper_automatic_fire_judgment_range": 0.29999999999999999,
                        "sniper_aim_pixel_range": 67,
                        "sniper_static_aim_speed": 1.4499996900558472,
                        "sniper_movement_tracking_speed": 0.14499996602535248,
                        "normal_gun_control_value": 1.2000000000000002
                    },
                    "mixers": 0,
                    "sync": 0,
                    "flags": 0,
                    "volume": 1.0,
                    "balance": 0.5,
                    "enabled": true,
                    "muted": false,
                    "push-to-mute": false,
                    "push-to-mute-delay": 0,
                    "push-to-talk": false,
                    "push-to-talk-delay": 0,
                    "hotkeys": {},
                    "deinterlace_mode": 0,
                    "deinterlace_field_order": 0,
                    "monitoring_type": 0,
                    "private_settings": {}
                }
            ]
        }
    ],
    "groups": [],
    "quick_transitions": [],
    "transitions": [],
    "saved_projectors": [],
    "current_transition": "淡入淡出",
    "transition_duration": 300,
    "preview_locked": false,
    "scaling_enabled": false,
    "scaling_level": 0,
    "scaling_off_x": 0.0,
    "scaling_off_y": 0.0,
    "modules": {
        "scripts-tool": [
            {
                "path": "G:/JST/JS/JS/obs_run.py",
                "settings": {}
            }
        ],
        "output-timer": {
            "streamTimerHours": 0,
            "streamTimerMinutes": 0,
            "streamTimerSeconds": 30,
            "recordTimerHours": 0,
            "recordTimerMinutes": 0,
            "recordTimerSeconds": 30,
            "autoStartStreamTimer": false,
            "autoStartRecordTimer": false,
            "pauseRecordTimer": true
        },
        "auto-scene-switcher": {
            "interval": 300,
            "non_matching_scene": "",
            "switch_if_not_matching": false,
            "active": false,
            "switches": []
        },
        "captions": {
            "source": "",
            "enabled": false,
            "lang_id": 2052,
            "provider": "mssapi"
        }
    },
    "version": 1
}

"first_part": 0, 不停,瞄头中

"first_part": 1, 停,瞄头顶

)不确定

"rifle_static_aim_speed": 1.145, 正常

"rifle_static_aim_speed": 小于等于1.0, 弧轨迹

### YOLOAI Gym中的集成 为了实现在AI Gym环境中使用YOLO进行目标检测,需要考虑几个方面。首先是环境配置,这涉及到安装必要的库和支持工具[^2]。通常情况下,在AI Gym中运行YOLO意味着要创建一个自定义的环境,该环境不仅支持标准的Gym接口还能够处理图像输入并应用YOLO模型来进行实时的目标识别。 #### 安装依赖项 确保已经安装了Python及其开发包,并设置了虚拟环境。接着按照官方文档说明安装PyTorch框架和其他必需的支持软件如OpenCV等。对于YOLO本身,则可以从GitHub上克隆相应的版本(比如YOLOv8),并依据其README文件完成本地设置[^1]。 ```bash pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 pip install opencv-python matplotlib numpy git clone https://github.com/ultralytics/ultralytics.git cd ultralytics && pip install -r requirements.txt ``` #### 创建自定义AI Gym环境 构建一个新的继承`gym.Env`类的新环境,重写`reset()`、`step(action)`方法以及其他任何特定于应用程序的方法。在这个新的环境中加入调用YOLO API的功能,以便每次接收到新帧时都可以执行对象检测操作[^3]。 ```python import gym from gym import spaces import cv2 import yolov8 # 假设这是你加载YOLO v8的方式 class CustomEnv(gym.Env): metadata = {'render.modes': ['human']} def __init__(self, ...): super(CustomEnv, self).__init__() # 初始化YOLO模型 self.model = yolov8.load('path/to/yolov8.pt') ... def step(self, action): observation, reward, done, info = super().step(action) # 使用当前观测作为图片输入给YOLO做推理 results = self.model(observation) detections = results.pandas().xyxy[0] # 更新状态或其他逻辑... return new_observation, reward, done, info def reset(self): obs = super().reset() # 可能还需要在这里做一些初始化工作 return obs ``` #### 集成与测试 一旦完成了上述步骤,就可以编写脚本来实例化这个定制化的环境,并尝试让智能体在一个简单的场景下运作起来。此时应该能看到YOLO正在处理来自模拟器的画面流,并返回有关所见物体的信息。随着进一步的发展,还可以探索更复杂的策略来利用这些信息指导行动选择过程[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值