/ML_micro

Primary LanguageJupyter Notebook

install prdicator file from here

URL

then but it in the root of the project

run it using docker

docker build -t my-fastapi-app .   
docker run -p 8000:8000 my-fastapi-app  

now your app will run on http://0.0.0.0:8000/

create venv

python3 -m venv venv

or

python -m venv venv

activate venv

source venv/bin/activate

install requirements

pip install -r requirements.txt

to run the server user

uvicorn main:app --host 0.0.0.0 --port 5000 --reload

train model

URLhttp://0.0.0.0:5000/predict/ :POST

Body:

{
    "image_path":"https://media.licdn.com/dms/image/C4D03AQH7OjbTNqDpDw/profile-displayphoto-shrink_400_400/0/1662213868889?e=1692835200&v=beta&t=x2W_6PuRkZNG8GfsdAacvplZ1UagBsCqC7GgfJrw6G0"
}

get data

URL:http://0.0.0.0:5000/train/

Body:

{
    "training_data": [
        {
            "image_path": "https://media.licdn.com/dms/image/C4D03AQH7OjbTNqDpDw/profile-displayphoto-shrink_400_400/0/1662213868889?e=1692835200&v=beta&t=x2W_6PuRkZNG8GfsdAacvplZ1UagBsCqC7GgfJrw6G0",
            "label": "post_id_1"
        },
        {
            "image_path": "https://media.licdn.com/dms/image/C5603AQEReSODdvboJw/profile-displayphoto-shrink_400_400/0/1633380703911?e=1692835200&v=beta&t=KSCuROEljCf7jLEi2YOP6Z7TSGEhf0qb_oxi9tdPIUw",
            "label": "post_id_2"
        },
        {
            "image_path": "https://media.licdn.com/dms/image/C5603AQEReSODdvboJw/profile-displayphoto-shrink_400_400/0/1633380703911?e=1692835200&v=beta&t=KSCuROEljCf7jLEi2YOP6Z7TSGEhf0qb_oxi9tdPIUw",
            "label": "post_id_3"
        }
    ]
}