Ryanshuai / pubg_derecoil

anti-recoil
5 stars 0 forks source link

how to use #1

Open Ertinhow opened 3 years ago

Ertinhow commented 3 years ago

Please, can you just explain how to use? just a path to begin.... pleaseeee

Ryanshuai commented 3 years ago

I have updated the PyTorch models, the code should now work. Install Anaconda and other libraries such as PyTorch, pyinput. (Just run 1_start_main.py, if anything is missing, install it.) Try run 1_start_main.py Ask me if you are in trouble, I am glad to see others using my code.

Ryanshuai commented 3 years ago

Change positions in pubg_derecoil/state/position_constant.py to change the crop position for image detection. My screen is 21:9, so you have to try to find yours for your screen. It is exhausting, but it automatically detects your weapon, your scope, so you don't have to use a special mouse for different weapons. Again, ask me if in trouble. I will try to modify my code to adapt more

Ertinhow commented 3 years ago

stuck on torchvision image

Ryanshuai commented 3 years ago

stuck on torchvision image

You need to install Cuda, which is a library for deep learning image detection that runs the detection model on the GPU. I will modify the code so that it can also run on the CPU. You can decide which to use according to your computer perfermance. And, have you downloaded deep learning models such as fire_mode.pth.tar to the correct location?

Ertinhow commented 3 years ago

I just follow the errors that appeared on runnig 1_start_main.py, and did pip install, I don't know nothing in python...

Ertinhow commented 3 years ago

what is the usage to cpu and gpu with this program? is it very high?

Ertinhow commented 3 years ago

what the correct location of fire_mode.pth.tar? pls make a tutorial

Ryanshuai commented 3 years ago

what the correct location of fire_mode.pth.tar? pls make a tutorial

ok, when I have time, wait several days.

Ertinhow commented 3 years ago

got stuck on this, pls help!!!!!! image

Ryanshuai commented 3 years ago

t stuck on this, pls help!!!!!!

Seems working, the white area shows the state of the weapon. Since the default firing mode is full, it is displayed as full. When everything is fine, it will show the scope rate, grip type, muzzle type.

Busy with work these days, I am on adding readme.

Ryanshuai commented 3 years ago

README updated, have a try. Good luck.

Ertinhow commented 3 years ago

I've readed but it seems so complicated, what I have to change? edit the file position_constant.py? and what make this script start? it's a lot of information without a basic tutorial for begginers.

msdart commented 3 years ago

README updated, have a try. Good luck.

Change positions in position_constant.py, enter training mode ,change weapons / others. nothing -full-1--- -full-1---

any idea?

Ryanshuai commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

msdart commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

Ryanshuai commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

msdart commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

Ryanshuai commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

msdart commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

Updated coordinates, now shows the type of weapon. The next question, posture and fire_mode at what coordinates are taken?

msdart commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

*The cropped image will be saved in for_data_check dir*

I have only temp_image, its ok?

Ryanshuai commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

Updated coordinates, now shows the type of weapon. The next question, posture and fire_mode at what coordinates are taken?

Currently, it is not used. This is a feature I will add in the future.

Ryanshuai commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

*The cropped image will be saved in for_data_check dir*

I have only temp_image, its ok?

Does it show the scope rate like "x4", muzzle type, grip type? If everything is displayed, the folder is not needed.

Ryanshuai commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

*The cropped image will be saved in for_data_check dir*

I have only temp_image, its ok?

And, if everything is correct. Could your share your screen resolution ratio and your state.position_constants.py?

msdart commented 3 years ago

Were you in the game? The image detector will be monitoring the screen to determine the status. The detector will work once when you push the button tab. Maybe the PUBG window mode needs to be the borderless mode

Play in window (noborder) mode. Temporary images are saved to the folder, but there is no reaction to changing weapons.

I guess nearly done, I did not consider other screen ratios before. I will try to add some modules for users to check if the cropping works properly. When it is not so busy.

Ok. I'm waiting. I would very much like to try out your creation)

readme updated, have a try.

*The cropped image will be saved in for_data_check dir*

I have only temp_image, its ok?

Does it show the scope rate like "x4", muzzle type, grip type? If everything is displayed, the folder is not needed.

I can check in more detail later.

msdart commented 3 years ago
crop_position = {
    'fire_mode': [1330, 1648, 1364, 1676],
    'in_tab': [100, 359, 114, 398],
    'posture': [1005, 705, 1048, 743],
    # 'in_scope': [1669, 1179, 1766, 1208],

    'gun1_name': [96, 1353, 96 + 35, 1353 + 64],
    'gun1_scope': [114, 1585],
    'gun1_muzzle': [247, 1308],
    'gun1_grip': [247, 1415],
    # 'gun1_magazine': [330, 2474],
    'gun1_butt': [247, 1737],

    'gun2_name': [328, 1348, 328 + 35, 1350 + 64],
    'gun2_scope': [345, 1580],
    'gun2_muzzle': [478, 1308],
    'gun2_grip': [478, 1415],
    # 'gun2_magazine': [636, 2474],
    'gun2_butt': [478, 1737]
}

1920x1080

Ryanshuai commented 3 years ago

I've readed but it seems so complicated, what I have to change? edit the file position_constant.py? and what make this script start? it's a lot of information without a basic tutorial for begginers.

crop_position = { 'fire_mode': [1330, 1648, 1364, 1676], 'in_tab': [100, 359, 114, 398], 'posture': [1005, 705, 1048, 743],

'in_scope': [1669, 1179, 1766, 1208],

'gun1_name': [96, 1353, 96 + 35, 1353 + 64],
'gun1_scope': [114, 1585],
'gun1_muzzle': [247, 1308],
'gun1_grip': [247, 1415],
# 'gun1_magazine': [330, 2474],
'gun1_butt': [247, 1737],

'gun2_name': [328, 1348, 328 + 35, 1350 + 64],
'gun2_scope': [345, 1580],
'gun2_muzzle': [478, 1308],
'gun2_grip': [478, 1415],
# 'gun2_magazine': [636, 2474],
'gun2_butt': [478, 1737]

} 1920x1080

Would you like to try this configuration?

msdart commented 3 years ago

Would you like to try this configuration?

Screenshot_9

Please see if everything is displayed correctly or not? Anti-recoil worked only 2 times ...

Ryanshuai commented 3 years ago

Would you like to try this configuration?

Screenshot_9

Please see if everything is displayed correctly or not? Anti-recoil worked only 2 times ...

These two weapons do not support fully automatic shooting mode. Use weapons like AKM, m762,m416, vector. Only the gun name is correct, I need to check what the detector's input is. Try to run the python script as an administrator to save the input image to dir for_data_check.

msdart commented 3 years ago

These two weapons do not support fully automatic shooting mode. Use weapons like AKM, m762,m416, vector. Only the gun name is correct, I need to check what the detector's input is. Try to run the python script as an administrator to save the input image to dir for_data_check.

If you leave the script running and exit the game, the left mouse button still continues to slide down)

Python running as admin, i have only temp_image folder, full size screen Screenshot_10

Ryanshuai commented 3 years ago

These two weapons do not support fully automatic shooting mode. Use weapons like AKM, m762,m416, vector. Only the gun name is correct, I need to check what the detector's input is. Try to run the python script as an administrator to save the input image to dir for_data_check.

If you leave the script running and exit the game, the left mouse button still continues to slide down)

Python running as admin, i have only temp_image folder, full size screen Screenshot_10

Use F12 to temporarily stop sliding down.

Weird... the program works fine on my computer. WeChat Screenshot_20210225235711

Check if it is in image_detect? Manually create a folder named for_data_check?

msdart commented 3 years ago

Check if it is in image_detect? Manually create a folder named for_data_check?

Create for_data_check - 0 imgs. temp_image - 1 img every TAB

I checked the script from AKA - the recoil decreases if I shoot. If I shoot from scope, recoil does not decrease.

Ryanshuai commented 3 years ago

Check if it is in image_detect? Manually create a folder named for_data_check?

Create for_data_check - 0 imgs. temp_image - 1 img every TAB

I checked the script from AKA - the recoil decreases if I shoot. If I shoot from scope, recoil does not decrease.

It is because the gun scope is not detected correctly. Okay, I will try to save the for_data_check image as a temp_image dose. It's too late, another day

Ryanshuai commented 3 years ago

Check if it is in image_detect? Manually create a folder named for_data_check?

Create for_data_check - 0 imgs. temp_image - 1 img every TAB

I checked the script from AKA - the recoil decreases if I shoot. If I shoot from scope, recoil does not decrease.

pip install -r requirements.txt to install the correct version of cv2 to save the images.

Protomove commented 3 years ago

Hello, thank you very much for sharing your code, I am excited to try it, I will try it in a few days

Protomove commented 3 years ago

Hello, a question, I can't detect the weapon correctly, what could it be due to?

Protomove commented 3 years ago

1 2

Ryanshuai commented 3 years ago

ion, I can't detect the weapon correctly, what could it be due t

Sorry for the late reply. I am currently busy. Glad to hear you are interested.

This misdetection is mainly due to the position of the icon, please try to make it accurate according to your screen. (As the README says)

Actually, I am writing a Golang version of derecoil, if you can upgrade any of these two, please pull request.

Protomove commented 3 years ago

Thank you very much, I am beginning to learn programming. If I manage to update one, I will inform you. To detect the position of the weapons do you use an application to know the size of the position? my level of english is low sorry hehe