Commit 934fd58c authored by janithgamage1.ed's avatar janithgamage1.ed
parents ee530442 4125f52b
This diff is collapsed.
import os
from fastapi import APIRouter, File, HTTPException, Query,UploadFile from fastapi import APIRouter, File, HTTPException, Query,UploadFile
from pydantic import BaseModel from pydantic import BaseModel
import tensorflow as tf import tensorflow as tf
...@@ -18,7 +19,15 @@ class ImageRequest(BaseModel): ...@@ -18,7 +19,15 @@ class ImageRequest(BaseModel):
# Load your Keras model # Load your Keras model
# model = tf.keras.models.load_model('../ML_Models/sign_language_to_text/models/sign_language_model.h5') # model = tf.keras.models.load_model('../ML_Models/sign_language_to_text/models/sign_language_model.h5')
model= None model_file_path = '../ML_Models/sign_language_to_text/models/sign_language_model.h5'
# Check if the model file exists
if os.path.exists(model_file_path):
# Load the Keras model if the file exists
model = tf.keras.models.load_model(model_file_path)
else:
model = None
CLASSES = mappings.classes CLASSES = mappings.classes
NUM_CLASSES = len(mappings.classes) # number of classes NUM_CLASSES = len(mappings.classes) # number of classes
IMG_SIZE = 224 # image size IMG_SIZE = 224 # image size
......
...@@ -7,3 +7,4 @@ moviepy==1.0.3 ...@@ -7,3 +7,4 @@ moviepy==1.0.3
SpeechRecognition==3.10.0 SpeechRecognition==3.10.0
tk==0.1.0 tk==0.1.0
requests==2.31.0 requests==2.31.0
pymongo==4.5.0
\ No newline at end of file
...@@ -154,7 +154,7 @@ const Process = () => { ...@@ -154,7 +154,7 @@ const Process = () => {
}; };
return ( return (
<> <>
<MainCard content={false}> <MainCard content={false} title="Translate Sinhala Sign Language into Text Here">
<ScrollX> <ScrollX>
{/* content here */} {/* content here */}
...@@ -233,7 +233,7 @@ const Process = () => { ...@@ -233,7 +233,7 @@ const Process = () => {
step={10} step={10}
marks marks
min={10} min={10}
max={110} max={100}
/> />
<h4>Speed - {speed}</h4> <h4>Speed - {speed}</h4>
</Grid> </Grid>
...@@ -331,7 +331,7 @@ const Process = () => { ...@@ -331,7 +331,7 @@ const Process = () => {
step={10} step={10}
marks marks
min={10} min={10}
max={110} max={100}
/> />
<h4>Speed - {speed}</h4> <h4>Speed - {speed}</h4>
</Grid> </Grid>
......
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
"learning-curriculums-subscribed": "My Courses", "learning-curriculums-subscribed": "My Courses",
"learning-lead-board": "Lead Board", "learning-lead-board": "Lead Board",
"learning-feedback": "Feedback", "learning-feedback": "Feedback",
"ssl-translate": "SSL Translate", "ssl-translate": "SSL Translation",
"emotion-detection": "Emotion Detection", "emotion-detection": "Emotion Detection",
"audio-detection": "Audio Detection", "audio-detection": "Audio Detection",
"video-detection": "Video Detection", "video-detection": "Video Detection",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment