diff --git a/app/Dockerfile b/app/Dockerfile index c4bc40b..4c82910 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,7 +1,13 @@ -FROM python:3.7 +FROM python:3.9 + EXPOSE 8501 + WORKDIR /app + COPY requirements.txt ./requirements.txt + RUN pip3 install -r requirements.txt + COPY . . + CMD streamlit run app.py \ No newline at end of file diff --git a/app/app.py b/app/app.py index deca06c..db61554 100644 --- a/app/app.py +++ b/app/app.py @@ -3,7 +3,7 @@ from PIL import Image from source import preprocess_input_image, batch_predict, conv_float_int, combine_image, load_trained_model, burn_area import numpy as np -from keras import backend as K +from tensorflow.compat.v1.keras import backend as K from tensorflow.python.lib.io import file_io import boto3 from keras.models import load_model diff --git a/app/requirements.txt b/app/requirements.txt index 53c13ab..c17f56a 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,6 +1,7 @@ -matplotlib==3.2.1 -numpy==1.18.4 -streamlit==0.59.0 -tensorflow==1.15.2 -Keras==2.0.0 -Pillow==7.1.2 +matplotlib==3.8.3 +numpy==1.26.4 +streamlit==1.31.1 +tensorflow==2.15.0.post1 +keras==2.15.0 +pillow==10.2.0 +boto3==1.34.49 \ No newline at end of file diff --git a/app/source.py b/app/source.py index 9a6fce8..1179b7f 100644 --- a/app/source.py +++ b/app/source.py @@ -1,7 +1,7 @@ import numpy as np from tensorflow.keras.models import load_model -from keras import backend as K +from tensorflow.compat.v1.keras import backend as K from PIL import Image def add_image_magin(input_image, im_width=720, im_height=480, color=0): diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..dbed1a4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' + +name: wildfire + +services: + app: + build: + context: ./app + dockerfile: Dockerfile + ports: + - 8501:8501 + volumes: + - ./app:/app \ No newline at end of file