This is a Flask web app which shows the images after segmenting using PSO.
Particle Swarm Optimization (PSO) is a popular optimization technique inspired by the collective behavior of bird flocking or fish schooling. It is commonly used to solve optimization problems in various fields, including image processing.
Image segmentation is the process of partitioning an image into multiple segments or regions based on certain criteria, such as color, texture, or intensity. It is a fundamental task in computer vision, and it has various applications, including object recognition, image analysis, and medical imaging.
PSO can be used for image segmentation because it is a powerful optimization technique that can find the optimal segmentation parameters by searching the solution space efficiently. PSO-based image segmentation algorithms typically define the fitness function based on the similarity of the segmented
Velocity Vector Update Equation:
Position Vector Update Equation:
Inertia Weight:
All the dependencies and required libraries are included in the file requirements.txt
See here
Data pre-processing is an important step for the creation of a machine learning model. Initially, data may not be clean or in the required format for the model which can cause misleading outcomes. In pre-processing of data, we transform data into our required format. It is used to deal with noises, duplicates, and missing values of the dataset. Data pre-processing has the activities like importing datasets, splitting datasets, attribute scaling, etc. Preprocessing of data is required for improving the accuracy of the model.
The Code is written in Python 3.9. If you don’t have Python installed you can find it here. If you are using a lower version of Python you can upgrade using the pip package, ensuring you have the latest version of pip. To install the required packages and libraries, run this command in the project directory after cloning the repository:
- Clone the repo
git clone https://github.com/Chaganti-Reddy/ISPSO.git
- Change your directory to the cloned repo
cd ISPSO
- Now, run the following command in your Terminal/Command Prompt to install the libraries required
python3 -m virtualenv my_env
source my_env/bin/activate
pip3 install -r requirements.txt
-
Open terminal. Go into the cloned project directory and type the following command:
python3 app.py
-
The other method is you can directly pull this project from my Dockerhub using:
docker pull chagantireddy/ispso:latest
-
Then run using:
docker run -it --rm -p 5000:5000 chagantireddy/ispso:latest
Color Image
Gray Scale Image
.
├── app.py
├── Dockerfile
├── LICENSE
├── pso.py
├── Readme.md
├── requirements.txt
├── static
│ ├── segmented_image.jpg
│ └── temp.jpg
├── templates
│ ├── index.html
│ └── result.html
└── tests
├── image.jpg
├── lena.png
└── tst.jpg
- To run it in more speed
- Optimize Flask app.py
- Optimize this Image Segmentation with different algorithm
Feel free to mail me for any doubts/query ✉️ [email protected]
You are allowed to cite any part of the code or our dataset. You can use it in your Research Work or Project. Remember to provide credit to the Maintainer Chaganti Reddy by mentioning a link to this repository and her GitHub Profile.
Follow this format:
- Author's name - Chaganti Reddy
- Date of publication or update in parentheses.
- Title or description of document.
- URL.
Made with ❤️ by Chaganti Reddy
MIT © Chaganti Reddy