Skip to content

Commit 015503a

Browse files
frontend readme + removed unnecessary comments
1 parent 47edc88 commit 015503a

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ flutter run
3838
```
3939

4040
## AI Model
41-
A Google AI gesture recognition model was used for ASL image recognition. This model was trained on a 2.7GB curated dataset compiled from various Kaggle repositories.
41+
A Google AI gesture recognition model was used for American Sign Language (ASL) image recognition. This model was trained on a 2.4GB dataset compiled from various Kaggle repositories.
4242
The model achieves an accuracy of 93.6% and a loss of 0.1563.
4343
In practice, the lighting of the environment significantly affects the accuracy of classification because the training data primarily consists of images with good to excellent lighting conditions.
4444
Other Hugging Face alternatives tested were slower and less accurate overall, based on our evaluations. Additionally, the training data predominantly features right-handed photos, so ASL letter recognition is expected to perform better for right-handed gestures.
@@ -49,6 +49,9 @@ A Mistral alternative was tested but found to be less effective. The OpenAI solu
4949

5050
## Frontend
5151

52+
- the `sign_language_translator/` directory
53+
54+
### Structure
5255
```
5356
lib/
5457
├── main.dart
@@ -57,6 +60,22 @@ lib/
5760
│ ├── camera.dart
5861
│ └── instructions_pop_up.dart
5962
└── services/
60-
└── network.dart
63+
└── network.dart # handles API requests for image upload and translation retrieval.
6164
```
6265

66+
### Components
67+
The app consists of one page with the following components:
68+
- camera, used to capture the signs that will be translated
69+
- button to change the camera in use (rear/frontal camera)
70+
- button to start/stop the translation
71+
- button that opens a pop-up with the usage instructions for the app
72+
- a text component, where the translation will be displayed
73+
74+
75+
### Translation Workflow
76+
1. Open the app.
77+
2. Tap **Start Translation** to begin.
78+
3. The app captures images periodically and sends them to the backend for processing.
79+
4. Tap **Stop Translation** to end the process.
80+
5. View the translation result displayed on the screen.
81+

sign_language_translator/lib/components/camera.dart

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'dart:async'; // pentru a folosi Timer-ul
1+
import 'dart:async';
22
import 'package:camera/camera.dart';
33
import 'package:flutter/material.dart';
44
import 'package:sign_language_translator/services/network.dart';
@@ -16,10 +16,9 @@ class CameraState extends State<Camera> {
1616
late List<CameraDescription> cameras;
1717
late CameraController cameraController;
1818
bool isRearCamera = true;
19-
Timer? _timer; // Timer pentru trimiterea imaginilor
20-
bool _isTranslationActive = false; // Flag pentru a controla procesul de traducere
19+
Timer? _timer;
20+
bool _isTranslationActive = false;
2121

22-
// Initialize Network instance
2322
final Network network = Network();
2423

2524
void startCamera(int camera) async {
@@ -54,7 +53,7 @@ class CameraState extends State<Camera> {
5453

5554
@override
5655
void dispose() {
57-
_timer?.cancel(); // Oprire timer când widget-ul este distrus
56+
_timer?.cancel();
5857
cameraController.dispose();
5958
super.dispose();
6059
}
@@ -127,7 +126,7 @@ class CameraState extends State<Camera> {
127126

128127
void _startSendingImages() {
129128
_isTranslationActive = true;
130-
_timer?.cancel(); // Oprire timer existent
129+
_timer?.cancel();
131130
_timer = Timer.periodic(const Duration(milliseconds: 500), (timer) async {
132131
if (_isTranslationActive &&
133132
cameraController.value.isInitialized &&
@@ -149,7 +148,7 @@ class CameraState extends State<Camera> {
149148

150149
Future<String> stopAndGetTranslation() async {
151150
_isTranslationActive = false;
152-
_timer?.cancel(); // Oprire timer
151+
_timer?.cancel();
153152

154153
// asigura ca se opreste upload-ul
155154
await Future.delayed(const Duration(milliseconds: 50));

0 commit comments

Comments
 (0)