Introduction This documentation provides step-by-step instructions for setting up an environment for cropping images using Python. The environment setup includes creating a virtual environment, installing required pip modules, and creating the necessary folders.
To follow these instructions, you will need to have Python 3 and pip installed on your computer.
To create a virtual environment for image cropping, open your command prompt or terminal and navigate to your project directory. Then, run the following command:
python -m venv envThis command creates a new virtual environment named "env" in your project directory.
After creating the virtual environment, activate it by running the following command:
source env/bin/activateThen, install the required pip modules by running the following command:
pip install -r requirements.txtThis command installs all the required modules listed in the "requirements.txt" file.
To prepare for image cropping, create two folders named "img" and "crop" in your project directory. The "img" folder will contain the original images, and the "crop" folder will contain the cropped images.
You can create the folders manually or use the following commands:
mkdir img
mkdir cropAfter completing these steps, you are ready to start cropping images using Python in your virtual environment. To use the virtual environment in your Python scripts, make sure to activate it before running any commands or scripts. You can activate the environment by running the command:
source env/bin/activate
python image_crop.py