Git Product home page Git Product logo

distributed-image-processing-on-aws's Introduction

Image Processing Web Application

This web application allows users to upload images and perform various processing tasks on them. The application is built using Flask and leverages multi-threading for handling concurrent requests and MPI (Message Passing Interface) for parallel processing of image tasks.

Demo

Features

  • Upload multiple images and specify processing operations.
  • Background processing of images using MPI for parallel execution.
  • Retrieve URLs of processed images.

Flask Application (Multi-threading)

The Flask app handles web requests and processes them using multi-threading to ensure responsiveness. When a file upload request is received, a background thread is started to handle MPI invocation, allowing the main server to continue processing other requests.

threading.Thread(target=invoke_mpi).start()

MPI Script (Multiple Processes)

The invoke_mpi() function in the Flask app calls an external script (mpi.py) using MPI. The script is executed with multiple processes to perform parallel image processing tasks efficiently.

MPI Command:

subprocess.run(['mpiexec', '-n', '2', 'python3', 'mpi.py'])
  • -n 2: Specifies the number of processes (2 in this case).
  • mpi.py: The script to be executed in parallel.

Requirements

  • Python 3.x
  • Flask
  • MPI (Message Passing Interface) implementation (e.g., Open MPI)
  • Necessary Python packages (flask, os, subprocess, threading, json)

Installation

  1. clone the repository:
    git clone https://github.com/abozaid01/Distributed-Image-Processing-on-AWS.git
    cd Distributed-Image-Processing-on-AWS/
  2. Create a virtual environment and install dependencies (optional):
    python3 -m venv venv
    source venv/bin/activate
    pip install flask
  3. Install MPI:
    sudo apt-get update
    sudo apt-get install -y mpich

Usage

  1. Start the Flask application:

    python3 server.py
  2. Access the application: Open your web browser and go to http://127.0.0.1:5000/.

  3. Upload images and specify operations:

    • Use the web interface to upload images and specify the desired operations for each image.
    • The application will save the uploaded files and queue the processing tasks.
  4. Retrieve processed images:

    • The application will process the images in the background using MPI.
    • You can retrieve the processed images from the specified URLs provided after uploading.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the MIT License. See the LICENSE file for details.

distributed-image-processing-on-aws's People

Contributors

abozaid01 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.