Skip to content

Commit

Permalink
final changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidd-77 committed Apr 6, 2024
1 parent c048842 commit bd2569b
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 21 deletions.
File renamed without changes.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.12.2-slim-bullseye

RUN apt update
WORKDIR /app

COPY . /app
RUN pip install -r requirements.txt

CMD [ "streamlit", "run", "application.py" ]
EXPOSE 8501
10 changes: 5 additions & 5 deletions dvc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ stages:
params.yaml:
AUGMENTATION: false
BATCH_SIZE: 32
EPOCHS: 3
EPOCHS: 1
IMAGE_SIZE:
- 224
- 224
- 3
outs:
- path: artifacts/training/model.keras
hash: md5
md5: 01755562fd9d3ed1d664ff14be8e7cc4
md5: 934d3e405115c3f1d202681e8ab3cf66
size: 59736021
evaluation:
cmd: python src/CNN_Classifier/pipeline/stage_04_model_evaluation.py
Expand All @@ -89,7 +89,7 @@ stages:
nfiles: 1201
- path: artifacts/training/model.keras
hash: md5
md5: 01755562fd9d3ed1d664ff14be8e7cc4
md5: 934d3e405115c3f1d202681e8ab3cf66
size: 59736021
- path: config/config.yaml
hash: md5
Expand All @@ -109,5 +109,5 @@ stages:
outs:
- path: scores.json
hash: md5
md5: 19499a5358bbd00a853051cfc9973d47
size: 60
md5: c3d8f8a15cf31bce1e464ab3a668ac72
size: 73
Binary file added model/model.keras
Binary file not shown.
2 changes: 1 addition & 1 deletion params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AUGMENTATION: False
IMAGE_SIZE: [224, 224, 3]
BATCH_SIZE: 32
INCLUDE_TOP: False
EPOCHS: 3
EPOCHS: 1
CLASSES: 4
WEIGHTS: imagenet
LEARNING_RATE: 0.001
22 changes: 10 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
tensorflow
pandas
dvc
mlflow
notebook
numpy
tensorflow==2.16.1
pandas==2.2.1
dvc==3.49.0
mlflow==2.11.3
notebook==7.1.2
numpy==1.26.4
matplotlib
seaborn
python-box
python-box==7.1.1
pyYAML
tqdm
ensure
setuptools
joblib
setuptools==69.2.0
joblib==1.3.2
types-pyYAML
scipy
gdown
streamlit
Flask
Flask-Cors
streamlit==1.32.2
-e .
4 changes: 2 additions & 2 deletions scores.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"loss": 8.38189428975511e-09,
"accuracy": 1.0
"loss": 0.4460182189941406,
"accuracy": 0.9750000238418579
}
5 changes: 5 additions & 0 deletions src/CNN_Classifier/components/model_training.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from CNN_Classifier.config.configuration import TrainingConfig
from pathlib import Path
import tensorflow as tf
import os


class Training:
Expand Down Expand Up @@ -88,4 +89,8 @@ def train(self):
self.save_model(
path=self.config.trained_model_path,
model=self.full_model
)
self.save_model(
path=os.path.join("model","model.keras"),
model=self.full_model
)
2 changes: 1 addition & 1 deletion src/CNN_Classifier/pipeline/prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, filename):
self.filename = filename

def predict(self, ):
model = load_model(os.path.join("artifacts","training", "model.keras"))
model = load_model(os.path.join("model","model.keras"))
imagename = self.filename
test_image = image.load_img(imagename, target_size=(224, 224))
test_image = image.img_to_array(test_image)
Expand Down
1 change: 1 addition & 0 deletions template.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
f"src/{project_name}/constants/__init__.py",
"config/config.yaml",
"dvc.yaml",
"model/model.keras",
"params.yaml",
"requirements.txt",
"setup.py",
Expand Down

0 comments on commit bd2569b

Please sign in to comment.