alifalhasan
commited on
Commit
β’
53b38a4
1
Parent(s):
bd74eb8
Update README.md
Browse files
README.md
CHANGED
@@ -1,7 +1,185 @@
|
|
1 |
---
|
|
|
|
|
|
|
|
|
2 |
license: mit
|
3 |
language:
|
4 |
- en
|
5 |
- ar
|
6 |
pipeline_tag: translation
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
title: Arabic2English
|
3 |
+
colorFrom: blue
|
4 |
+
colorTo: purple
|
5 |
+
sdk: gradio
|
6 |
license: mit
|
7 |
language:
|
8 |
- en
|
9 |
- ar
|
10 |
pipeline_tag: translation
|
11 |
+
metrics:
|
12 |
+
- accuracy
|
13 |
+
library_name: transformers
|
14 |
+
---
|
15 |
+
|
16 |
+
# Model Card
|
17 |
+
|
18 |
+
## Overview
|
19 |
+
|
20 |
+
- **Model name:** Arabic2English Translation
|
21 |
+
- **Model description:** Translates between Arabic and English.
|
22 |
+
- **Authors:** Alif Al Hasan
|
23 |
+
- **Repository link:** https://huggingface.co/spaces/alifalhasan/arabic2english/tree/main
|
24 |
+
- **License:** MIT
|
25 |
+
- **Contact information:** [email protected]
|
26 |
+
|
27 |
+
## Performance
|
28 |
+
|
29 |
+
- **Metrics:** Accuracy (100%)
|
30 |
+
- **Dataset:** Approximately 5,000 images of EPL team emblems, balanced across classes. Sources and preprocessing steps described in detail further below.
|
31 |
+
|
32 |
+
## Data
|
33 |
+
|
34 |
+
- **Training data:**
|
35 |
+
- Size: 5,000 images
|
36 |
+
- Class distribution: Balanced (1,000 images per class)
|
37 |
+
- Sources: [English Premier League Logo Detection](https://www.kaggle.com/datasets/alexteboul/english-premier-league-logo-detection-20k-images)
|
38 |
+
- Preprocessing: Resizing to 224x224 pixels, normalization
|
39 |
+
- **Potential biases:** Currently unknown biases in the dataset.
|
40 |
+
|
41 |
+
## Inference
|
42 |
+
|
43 |
+
- **Input:**
|
44 |
+
- Format: JPEG or PNG images
|
45 |
+
- Size: 224x224 pixels
|
46 |
+
- Color space: RGB
|
47 |
+
- **Output:** Predicted class probabilities for each of the 5 EPL teams.
|
48 |
+
- **Inference API:** [https://huggingface.co/spaces/alifalhasan/epl-top5-emblem-classifier](https://huggingface.co/spaces/alifalhasan/epl-top5-emblem-classifier)
|
49 |
+
- **Usage instructions:** Simply upload an image of any of the EPL's top 5 team's emblem to get a prediction.
|
50 |
+
|
51 |
+
## Ethics
|
52 |
+
|
53 |
+
- **Potential biases:** The model may inherit biases from the training data, such as over- or under-representation of certain team emblems.
|
54 |
+
- **Mitigation strategies:** Further exploration of dataset biases and potential augmentation techniques to address them.
|
55 |
+
- **Ethical considerations:**
|
56 |
+
- Awareness of potential biases and limitations in the model's predictions.
|
57 |
+
- Responsible use of the model, avoiding harmful generalizations or discrimination.
|
58 |
+
- Respect for the rights and privacy of individuals and organizations associated with the EPL teams.
|
59 |
+
|
60 |
+
---
|
61 |
+
|
62 |
+
|
63 |
+
# Top 5 EPL Teams' Emblem Identifier
|
64 |
+
A simple and well designed web app to identify the emblem of the top 5 teams of **EPL(English Premier League)** namely **Arsenal, Chelsea, Liverpool, Manchester City** and **Manchester United**.
|
65 |
+
|
66 |
+
|
67 |
+
### Requirements
|
68 |
+
- [Python 3.11](https://python.org/)
|
69 |
+
- [NumPy](https://numpy.org/)
|
70 |
+
- [SciPy](https://scipy.org/)
|
71 |
+
- [Gradio](https://www.gradio.app/)
|
72 |
+
- [Tensorflow](https://tensorflow.org/)
|
73 |
+
|
74 |
+
|
75 |
+
### Table Of Contents
|
76 |
+
- [Introduction](#introduction)
|
77 |
+
- [Model Architecture](#model-architecture)
|
78 |
+
- [Project Architecture](#project-architecture)
|
79 |
+
- [How To Run](#how-to-run)
|
80 |
+
- [License](#license)
|
81 |
+
- [Contributor](#contributor)
|
82 |
+
|
83 |
+
|
84 |
+
### Introduction
|
85 |
+
A simple and well designed web app to identify the emblem of the top 5 teams of **EPL**. This model has been trained with a balanced dataset which contains almost **5k** images of the emblems of the teams.
|
86 |
+
|
87 |
+
|
88 |
+
### Model Architecture
|
89 |
+
The model utilizes a straightforward convolutional neural network (CNN) architecture, comprising the following layers:
|
90 |
+
|
91 |
+
1. **Convolutional Layer:**
|
92 |
+
- 32 filters, each of size 3x3
|
93 |
+
- ReLU activation function
|
94 |
+
- Input shape: 224x224x3 (RGB images)
|
95 |
+
- Extracts spatial features from input images.
|
96 |
+
|
97 |
+
2. **Max Pooling Layer:**
|
98 |
+
- Pool size: 2x2
|
99 |
+
- Reduces spatial dimensions for capturing more global features.
|
100 |
+
|
101 |
+
3. **Flattening Layer:**
|
102 |
+
- Flattens the 2D feature maps into a 1D vector for input to dense layers.
|
103 |
+
|
104 |
+
4. **Dense Layer 1:**
|
105 |
+
- 64 neurons
|
106 |
+
- ReLU activation function
|
107 |
+
|
108 |
+
5. **Output Layer (Dense Layer 2):**
|
109 |
+
- 5 neurons (matching the number of classes)
|
110 |
+
- Softmax activation to produce probability scores for each class.
|
111 |
+
|
112 |
+
**Key Points:**
|
113 |
+
- Input image size: 224x224 pixels
|
114 |
+
- Optimizer: Adam with a learning rate of 0.001
|
115 |
+
- Loss function: Categorical crossentropy
|
116 |
+
- Performance metric: Accuracy
|
117 |
+
|
118 |
+
**Visual Representation:**
|
119 |
+
[Input image (224x224x3)] --> [Conv2D] --> [MaxPooling2D] --> [Flatten] --> [Dense 1] --> [Output Layer (Dense 2)] --> [Predicted class]
|
120 |
+
|
121 |
+
|
122 |
+
### Prject Architecture
|
123 |
+
```
|
124 |
+
βββ data
|
125 |
+
β βββ arsenal - images of arsenal's emblem.
|
126 |
+
β βββ chelsea - images of chelsea's emblem.
|
127 |
+
β βββ liverpool - images of liverpool's emblem.
|
128 |
+
β βββ manchester-city - images of manchester-city's emblem.
|
129 |
+
β βββ manchester-united - images of united's emblem.
|
130 |
+
β
|
131 |
+
β
|
132 |
+
βββ model
|
133 |
+
β βββ football_logo_model.h5 - generated model.
|
134 |
+
β
|
135 |
+
β
|
136 |
+
βββ src
|
137 |
+
β βββ classify
|
138 |
+
β βββ classify.py - this module classifies the emblem from input image.
|
139 |
+
β βββ train
|
140 |
+
β βββ trainer.py - this module trains the model.
|
141 |
+
β
|
142 |
+
β
|
143 |
+
βββ app.py - this module starts the app interface.
|
144 |
+
β
|
145 |
+
β
|
146 |
+
βββ LICENSE - license file of this project.
|
147 |
+
β
|
148 |
+
β
|
149 |
+
βββ README.md - readme file of this project.
|
150 |
+
β
|
151 |
+
β
|
152 |
+
βββ requirements.txt - list of required packages.
|
153 |
+
```
|
154 |
+
|
155 |
+
### How To Run
|
156 |
+
First, install dependencies
|
157 |
+
```bash
|
158 |
+
# clone project
|
159 |
+
git clone https://huggingface.co/spaces/alifalhasan/epl-top5-emblem-classifier
|
160 |
+
|
161 |
+
# install project
|
162 |
+
cd epl-top5-emblem-classifier
|
163 |
+
pip install -r requirements.txt
|
164 |
+
```
|
165 |
+
|
166 |
+
Next, download the dataset from [here](https://drive.google.com/file/d/1O5Mm-86AlUf5fUYf1NS8J_t22h7h_UbQ/view?usp=sharing). First unzip the folder. **dataset** folder contains **five** more folders. Copy them and paste into the **data** directory of this project folder.
|
167 |
+
|
168 |
+
Now train the model using this command:
|
169 |
+
```bash
|
170 |
+
python src/train/trainer.py
|
171 |
+
```
|
172 |
+
|
173 |
+
Finally, deploy the model using this command:
|
174 |
+
```bash
|
175 |
+
python app.py
|
176 |
+
```
|
177 |
+
|
178 |
+
### License
|
179 |
+
Distributed under the MIT License. See `LICENSE` for more information.
|
180 |
+
|
181 |
+
|
182 |
+
### Contributor
|
183 |
+
Alif Al Hasan - [@alifalhasan](https://huggingface.co/alifalhasan) - [email protected]
|
184 |
+
|
185 |
+
Project Link: [https://huggingface.co/spaces/alifalhasan/epl-top5-emblem-classifier](https://huggingface.co/spaces/alifalhasan/epl-top5-emblem-classifier)
|