### Install Tesseract and Dependencies Source: https://github.com/lsdvaibhav/wildfire/blob/main/README.md Instructions to install the Tesseract OCR engine using Homebrew and to install project dependencies using pip. ```bash brew install tesseract pip install -r requirements.txt ``` -------------------------------- ### Start Local Development Server Source: https://github.com/lsdvaibhav/wildfire/blob/main/README.md Command to navigate to the source directory and start the FastAPI application locally using uvicorn. ```bash cd src uvicorn server:app --reload ``` -------------------------------- ### Project Dependencies Source: https://github.com/lsdvaibhav/wildfire/blob/main/requirements.txt This snippet lists the Python packages and their version requirements for the wildfire project. These dependencies cover web framework, machine learning, and utility libraries. ```python aiofiles==0.6.0 click==7.1.2 fastapi==0.61.1 h11==0.11.0 Jinja2==2.11.2 MarkupSafe==1.1.1 pydantic==1.7 python-multipart==0.0.5 six==1.15.0 starlette==0.13.6 typing-extensions==3.7.4.3 uvicorn==0.12.2 Keras==2.1.5 tensorflow==2.0.0 numpy==1.14.0 opencv-python==4.5.1.48 ``` -------------------------------- ### Perform OCR with Image Upload Source: https://github.com/lsdvaibhav/wildfire/blob/main/templates/index.html This JavaScript function captures image files from a file input element, prepares them for upload using FormData, and sends them to a '/predict' endpoint via an AJAX POST request. It displays the prediction result using swal. ```javascript function performOCR() { var files = document.getElementById("image_file").files; var formData = new FormData(); var endpoint = '/predict'; formData.append('image', files[0]); $.ajax({ type: 'POST', url: endpoint, data: formData, contentType: false, cache: false, processData: false, success: function(data) { swal("Predicton", data.prediction); } }); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.