DermAI Server is the backend component of the DermAI application, designed to handle image classification requests for skin conditions using a pre-trained AI model. This server is built using Flask and can process images sent via POST requests, returning predictions based on the provided image.
Ensure that you have the following installed in your environment before setting up the DermAI server:
- Python: Install Python
- Flask: Install Flask via pip (
pip install flask
) - Ngrok: Install Ngrok
- Git: Install Git
Follow these steps to set up and run the DermAI server:
-
Clone the Repository:
Clone the DermAI server repository from GitHub:git clone https://github.com/The-Vegapunks/dermai.git cd dermai
-
Install Python Dependencies:
Install the required Python packages listed in therequirements.txt
file:pip install -r requirements.txt
-
Configure the Server:
Ensure that the server is correctly set up to use the pre-trained AI model. The model file should be placed in the appropriate directory as specified in the project. -
Run the Server:
Start the Flask server:flask run
By default, the server will start on
http://127.0.0.1:5000/
. -
Expose the Server Using Ngrok:
If you need to access the server remotely, use Ngrok to expose it:ngrok http 5000
Copy the public URL generated by Ngrok (e.g.,
https://xxxxxx.ngrok.io
) for use in API requests.
The DermAI server provides an endpoint for making predictions based on images. Here's how to interact with the server:
- Endpoint:
/predict
- Method: POST
- Description: This endpoint accepts an image and returns a prediction of the skin condition.
The POST request should include the image in a multipart form-data format with the key 'image'
.
You can test the /predict
endpoint using tools like Postman
or curl
by sending an image file as described above. Ensure that your server is running and accessible via the URL provided by Ngrok if you are testing remotely.
With the DermAI server set up and running, you can now process images for skin condition classification via the /predict
endpoint. This server is a critical component of the DermAI application, enabling AI-driven healthcare solutions. If you encounter any issues or need further customization, refer to the project documentation or contact the development team.