Skip to content

Commit 1bc1247

Browse files
Rename API, update Dockerfile and dependencies.
1 parent 986334c commit 1bc1247

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN apt-get install -y libglib2.0-0
88
RUN pip install git+https://github.com/UPstartDeveloper/Fire-Detection-API
99
EXPOSE 8080
1010

11-
ENTRYPOINT uvicorn main:app --host 0.0.0.0 --port 8080 --workers 1
11+
ENTRYPOINT uvicorn app.main:app --host 0.0.0.0 --port 8080 --workers 1

app/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22

33
from fire_classifier.predictor import ImagePredictor
44

5-
app = FastAPI()
5+
app = FastAPI(
6+
title="Fire Detection API",
7+
description="Informs the probability that an image contains fire."
8+
)
69

710
predictor_config_path = "./app/config.yaml"
811

912
predictor = ImagePredictor.init_from_config_url(predictor_config_path)
1013

1114

12-
@app.post("/scorefile/")
15+
@app.post("/classify-image/")
1316
def create_upload_file(file: UploadFile = File(...)):
17+
'''Predicts the possibility that a RBG image contains fire.'''
1418
return predictor.predict_from_file(file.file)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
numpy
22
tensorflow-cpu
33
fastapi==0.49.0
4-
opencv-python==4.5.3.56
4+
opencv-python-headless==4.5.3.56
55
PyYAML==5.3
66
uvicorn
77
python-multipart

0 commit comments

Comments
 (0)