- +91 7075575787
- [email protected]
- Moosarambagh, Hyderabad
In this article, we’ll find out how to rename and resize the image using python.
The resize means returns an photo whose width and height precisely in shape the handed in price.
Python technique rename() renames the report or directory src to dst. If dst is a file or directory(already present), OS Error can be raised.
In rename.py file, We just import OS module and then make a function in that we make a variable where we gave the path of the images where they are situated. Then by count method, We count the number of files and then by rename method we rename the image names by giving what user wished for.
In resize.py file, We use Pillow module and import Image library and then we gave the image path and store it in one variable. Create two variables and then store im.size in it which means this two variables are used for the dimensions of the image. Make 4 variables and write the specifications of it which the user wished for and by using crop() method pass them as a parameters and here the image is resized. To display use im.show(). The results are shown in the folder.
Note: Make sure you have added path while installing the software’s.
https://techieyantechnologies.com/2022/07/how-to-install-anaconda/
4.<<directory of your file:>>. E.g., If my file is in d drive, then
5.Type d:
7. If your project is in c drive, you can ignore step 4 and go with step 5
8. Run pip install -r requirements.txt or conda install requirements.txt (Requirements.txt is a text file consisting of all the necessary libraries required for executing this python file. If it gives any error while installing libraries, you might need to install them individually.), example: pip install “module_name” i.e., pip install pandas
9. If you would like to run .ipynb file, Please follow the link to setup and open jupyter notebook, You will be redirected to the local server there you can select which ever .ipynb file you’d like to run and click on it and execute each cell one by one by pressing shift+enter.
Note: There are 4 different files each seeves different purpose such as,
Please follow the above sequence if you would like to execute and the files require good system requirements to run.
Rename:
Refer to the Below links to get more details on installing python and anaconda and how to configure it.
https://techieyantechnologies.com/2022/07/how-to-install-anaconda/
All the required data has been provided over here. Please feel free to contact me for model weights and if you face any issues.
https://techieyantechnologies.com/contact/
Yes, you now have more knowledge than yesterday, Keep Going.
How can we help you?
🟢 we are online | privacy policy
WhatsApp us