Spaces:
Sleeping
Sleeping
Niharmahesh
commited on
Commit
•
a12833f
1
Parent(s):
365e773
Update readme.md
Browse files
readme.md
CHANGED
@@ -1,36 +1,53 @@
|
|
1 |
-
# ASL Recognition App
|
2 |
|
3 |
-
This
|
4 |
|
5 |
-
##
|
6 |
|
7 |
-
1. **Image
|
8 |
-
2. **
|
|
|
|
|
|
|
9 |
|
10 |
-
##
|
11 |
|
12 |
-
|
|
|
13 |
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
|
|
|
23 |
|
24 |
-
###
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
|
|
|
34 |
The preprocessed features (angles) are used as input to our Random Forest model for ASL sign classification.
|
35 |
|
36 |
-
This preprocessing pipeline ensures that our model receives consistent and informative features, regardless of the hand's position or size in the original image.
|
|
|
|
|
|
|
|
|
|
1 |
+
# ASL Recognition App
|
2 |
|
3 |
+
This application recognizes American Sign Language (ASL) hand signs using image processing and machine learning techniques.
|
4 |
|
5 |
+
## How it works
|
6 |
|
7 |
+
1. **Image Upload**: Users can upload an image of an ASL hand sign.
|
8 |
+
2. **Hand Detection**: The app uses MediaPipe to detect hand landmarks in the image.
|
9 |
+
3. **Feature Extraction**: Angles between hand landmarks are calculated and normalized.
|
10 |
+
4. **Prediction**: A Random Forest model predicts the ASL sign based on the extracted features.
|
11 |
+
5. **Visualization**: The app displays the detected hand landmarks and top predictions.
|
12 |
|
13 |
+
## Supported Alphabets
|
14 |
|
15 |
+
The app currently works for the following ASL alphabets:
|
16 |
+
A, B, C, E, F, G, H, I, J, K, L, O, Q, R, S, W, Y
|
17 |
|
18 |
+
The app does not support or may not work correctly for:
|
19 |
+
D, M, N, P, T, U, V, X, Z
|
20 |
|
21 |
+
Note: The model's performance may vary and is subject to improvement.
|
22 |
|
23 |
+
## Image Preprocessing and Feature Extraction
|
24 |
|
25 |
+
### Image Preprocessing
|
26 |
+
- Image Loading: We use OpenCV (cv2) to load and process images.
|
27 |
+
- Color Conversion: Images are converted from BGR to RGB color space for compatibility with MediaPipe.
|
28 |
|
29 |
+
### Hand Landmark Detection
|
30 |
+
We use MediaPipe Hands for detecting hand landmarks in the images:
|
31 |
+
- MediaPipe Hands: Initializes with `static_image_mode=True`, `max_num_hands=1`, and `min_detection_confidence=0.5`.
|
32 |
+
- Landmark Extraction: 21 hand landmarks are extracted from each image.
|
33 |
|
34 |
+
### Feature Extraction
|
35 |
|
36 |
+
#### Landmark Normalization
|
37 |
+
1. Centering: Landmarks are centered by subtracting the mean position.
|
38 |
+
2. Scaling: Centered landmarks are scaled to unit variance.
|
39 |
|
40 |
+
#### Angle Calculation
|
41 |
+
We calculate angles between all pairs of landmarks:
|
42 |
+
1. Vector Calculation: For each pair of landmarks (i, j), we calculate the vector from i to j.
|
43 |
+
2. Angle Computation: We compute the arcosine of the x and y components of the normalized vector.
|
44 |
+
3. Feature Vector: The angles form a 420-dimensional feature vector (21 choose 2 = 210 pairs, 2 angles per pair).
|
45 |
|
46 |
+
### Model Input
|
47 |
The preprocessed features (angles) are used as input to our Random Forest model for ASL sign classification.
|
48 |
|
49 |
+
This preprocessing pipeline ensures that our model receives consistent and informative features, regardless of the hand's position or size in the original image.
|
50 |
+
|
51 |
+
## Usage
|
52 |
+
|
53 |
+
The "View Hand Landmarks" tab allows users to see hand landmarks for pre-loaded ASL signs. Select one or more alphabets from the supported list to view their corresponding hand landmarks.
|