Commit 5255e52b authored by Paranagama R.P.S.D.'s avatar Paranagama R.P.S.D.

fix : UI issues & flow issues

parent 73d8a7a0
...@@ -107,18 +107,27 @@ export default function AboutPage() { ...@@ -107,18 +107,27 @@ export default function AboutPage() {
// Video Upload // Video Upload
const translateSignLanguageToText = async () => { const translateSignLanguageToText = async () => {
setLoading(true); if (file) {
const formData = new FormData(); setLoading(true);
formData.append('video_request', file, 'test_video.mp4'); const formData = new FormData();
formData.append('video_request', file, 'test_video.mp4');
try { try {
const response = await SignLanguageToTextService.predictSignLanguageVideo(10, formData); const response = await SignLanguageToTextService.predictSignLanguageVideo(10, formData);
console.log(response.data); if (response.status == 200) {
setValue(response.data.predictions); console.log(response.data);
setLoading(false); setValue(response.data.predictions);
} catch (error) { } else {
console.log(error); enqueueSnackbar('Something went Wrong!', { variant: 'error' });
setLoading(false); }
setLoading(false);
} catch (error) {
console.log(error);
setLoading(false);
enqueueSnackbar('Something went Wrong!', { variant: 'error' });
}
} else {
enqueueSnackbar('Please select a file.', { variant: 'warning' });
} }
}; };
...@@ -251,7 +260,7 @@ export default function AboutPage() { ...@@ -251,7 +260,7 @@ export default function AboutPage() {
<Box sx={{ flexGrow: 1 }}> <Box sx={{ flexGrow: 1 }}>
<Card> <Card>
<CardHeader title="Upload a video containing Sign Language" /> <CardHeader title="Capture a video containing Sign Language" />
<Grid container spacing={2}> <Grid container spacing={2}>
<Grid item xs={12} md={6}> <Grid item xs={12} md={6}>
<Card> <Card>
......
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