Commit b6e30e1f authored by chameera's avatar chameera

Replace README.md relevant to Dysgraphia function

parent bf57cadd
# LearnJoy-ML
# Learn Joy - Function 2
## Table of Contents
[Function 2 Development](#function-2-development)
* [1. About Function 2](#1-About-function-2)
* [2. Dataset](#2-Dataset-folder)
* [3. Function 2 processing & ML Model Development](#3-Function-2-processing-&-ML-Model-Development-folder)
* [4. Service Files](#4-Service-Files-folder)
* [5. Fast API & app file](#5-Fast-API-&-app-file-folder)
-------------------------------------------------
## Function 2 Development
### 1.About Function 2
- This function include one main part:
- 1.Creating a comprehensive digital platform that easily converts handwritten
content into digital text with the aim of reducing the difficulties caused by
Dysgraphia:
### 2. Dataset ()
- Within this Kaggle Link, you'll discover data for Alphabets and Digits: only use 5000 training and 1000 testing date for each classes.
### 3. Function 2 processing & ML Model Development ([Folder](/function2))
- Inside this folder, you'll come across two Jupyter Notebooks dedicated to data preprocessing and model training:
- `character-recognition.ipynb`: This file primarily involves to training Character recognition model.
-
- ` function2.pyind`: This file is responsible for all methods of function 1.
### 4. Service Files ()
- Within this directory, there are one python ".py" file:
- `Handwriting_recognition.py`: This method is responsible for recognized the image for below mention classes.
- input : TWO IMAGE FILES `def Handwriting_recognition(BB_image:str=None,WB_image:str=None)`
Note : Add the only one image file for one time other file was None
- Attached models : Handwriting_recognition_1.hdf5([Link](https://drive.google.com/file/d/1cVw535rjWQl2SitToPzcjB6UU-dkfU_E/view?usp=drive_link))
- Process : Recognized the characters input images for below classes . `['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
`
- output : Recognized charcter.
---------------------
### 5. Fast API & app file ()
- Within this app.py module include two Fast API end points for function 2 :
- 1. Request body : Add the white image in black background
```python
@app.post("/function02/recognition_BB")
async def function2_recognition(BB_image:UploadFile =File(...)):
```
- Request URL: ` https://Public_or_local_host.app/function02/recognition_BB`
- Response body:
```json
{
"Recognized Character": "G"
}
```
- 2. Request body : Add the black image in white background
```python
@app.post("/function02/recognition_WB")
async def function2_recognition(WB_image:UploadFile =File(...)):
```
- Request URL: ` https://Public_or_local_host.app/function02/recognition_WB`
- Response body:
```json
{
"Recognized Character": "Q"
}
```
Machine Learning Model for Learnjoy app
------------------
## FastAPI Development
- To run the API, please ensure you have installed the required packages, "fastapi" and "uvicorn." If you haven't already installed them, you can do so using the following commands:
```bash
pip install fastapi
pip install "uvicorn[standard]"
```
- Once these packages are installed, you can proceed to run the API.
1. To run the api, use the following command inside the API folder:
```bash
python main.py
```
2. You can access the project output in your browser using the following URL:
```bash
http://127.0.0.1:8000
```
3. To explore the API documentation, visit:
```bash
http://127.0.0.1:8000/docs
```
------------------------
## Setting Up the Development Environment
Follow these steps to set up your development environment for this project:
### Create a New `venv`
1. Navigate to your project directory:
```bash
cd /path/to/your/project
```
2. Create a virtual environment:
```bash
python -m venv <venv_name>
```
### Activate and Deactivate `venv`
- In `cmd`:
```bash
<venv_name>\Scripts\activate
```
- In bash:
```bash
source <venv_name>/Scripts/activate
# To deactivate the virtual environment:
deactivate
```
### Create, Activate & Deactivate `venv` using conda
- Use Anaconda Navigator to create a venv:
```bash
# Activate the conda environment
conda activate <venv_name>
# To deactivate the conda environment
conda deactivate
```
### Install the Dependencies
- You can also use a `requirements.txt` file to manage your project's dependencies. This file lists all the required packages and their versions.
1. Install packages from `requirements.txt`:
```
pip install -r requirements.txt
```
This ensures that your development environment matches the exact package versions specified in `requirements.txt`.
2. Verify installed packages:
```bash
pip list
```
This will display a list of packages currently installed in your virtual environment, including the ones from `requirements.txt`.
\ No newline at end of file
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