вторник, 10 декабря 2024 г.

AI coder: mouse clicker

Continuing the series of articles on using ChatGPT as a software developer. In this article, I will show you how to ask ChatGPT to create a script that performs a click at a specific position via the mouse using a hotkey. Here is the initial version of the chat where I ask what I can use to do it, and in the subsequent chat, I finalize the script (copy the latest version of the script by clicking "copy code" in the upper right corner of the script window in the chat, and paste it into a new text file, naming it, for example, "2clicks.ahk"). They are in Russian, but you can ask Google Chrome to translate them into your language.

Now, you can run the script by double-clicking it if you have installed the AutoHotKey v2 tool. You can assign positions to click using "Alt-F5" and "Alt-F6", and click on them afterward using "F5" and "F6", respectively. You can change the hotkeys in the script, adjust their numbers, etc. To stop the script, unload it via the "H" icon in the tray area or use "Suspend Hotkeys" to temporarily disable the hotkeys.

Do you want help using ChatGPT? Drop me a message at virtualvat@gmail.com!

понедельник, 9 декабря 2024 г.

AI coder: project DocPic

Starting a series of articles about ChatGPT use for software developers. Even if you are not a software developer, you can still easily create code for your needs using such a powerful modern tool as AI! I prefer to use ChatGPT, but nowadays there are several approaches that allow you to do the same—just choose the one that suits you. For my first example, I'd like to demonstrate how to extract a picture for documents using face detection in a photo. The script is written in Python—install it on your computer and run the script, which you can copy from this chat with ChatGPT: Project DocPic. Explore the chat to see how easy it is to do the same yourself, even without any knowledge of programming! It's in Russian, but you can ask Google Chrome to translate it into your language.

To create the script, create a new text file, copy the latest version from the chat (click "copy code" in the upper right corner of the script window), and name it, for example, DocPic.py.

Now, just take a photo of a person and pass it as a parameter to the script along with the required proportions for the photo, e.g.:

python DocPic.py <image_path> <aspect_width> <aspect_height>

For example, to make a photo for documents with a 3x4 aspect ratio, use:

python DocPic.py mypic.png 3 4

If you see any errors indicating that a specific module isn't found, you can install it via the command line using PIP, e.g.:

pip install dlib

It's better to use a command line started as an administrator (press Win+R, type "cmd", and press CTRL+SHIFT+Enter) to install any missing modules.

If you see any other errors, just ask ChatGPT how to resolve them :)

Here is an example of the source picture:


And here is how the script transforms it:

Do you want help using ChatGPT? Drop me a message at virtualvat@gmail.com!