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!
Комментариев нет:
Отправить комментарий