GeekyYouthsInfo / Deep-Learning-Cataract-Detection

Academic: Deep learning-based mobile app to accurately identify the presence and severity of cataracts, enabling early diagnosis and treatment.
0 stars 1 forks source link

add api endpoint and consume it #26

Closed jona42-ui closed 2 months ago

jona42-ui commented 2 months ago

This commit addresses two things;

  1. Adds the backed process for the model including the API end point predict/ accessed as /api/predict at http://your-django-server-ip:8000/api/predict/

Note that when setting this up, you will need to include the model(named final_model.pth) in the /predictions app directory to be able to load the model and make the inferences. Be sure to also adjust the modelpath in the ml_model.py file. Given that the model size is large, I was not able to upload it with the files.

I tested the endpoint using curl and it did work so I expect it to work unless otherwise Screenshot from 2024-06-05 16-17-56

Screenshot from 2024-06-05 16-15-30

  1. Updated the react Native up to consume the endpoint. This need to be run and tested.

Once everything is running, next is to host the model and expose endpoints

NOTE: You need to setup the server first then the reactapp next for you to hit the end point.

server spin up command:

 python manage.py runserver

app command:

  npx react-native run-android

LINK TO MODEL: https://drive.google.com/file/d/19LPH0tCl8oJSkORE_OKt4T2gAJxf62hR/view?usp=sharing