{"id":20338710,"url":"https://github.com/Voyrox/SketchCalc","last_synced_at":"2025-05-08T02:31:44.749Z","repository":{"id":249474957,"uuid":"828481905","full_name":"Voyrox/SketchCalc","owner":"Voyrox","description":"Uses machine learning to predict the drawn symbols and converts them into a formal mathematical expression. It then evaluates the expression to provide the calculated answer.","archived":false,"fork":false,"pushed_at":"2025-04-24T06:47:40.000Z","size":113,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T09:28:40.279Z","etag":null,"topics":["machine-learning","mathematics","neural-network","shapes","tensoflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Voyrox.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-14T09:34:58.000Z","updated_at":"2025-04-24T06:47:44.000Z","dependencies_parsed_at":"2024-07-21T07:22:14.347Z","dependency_job_id":"72345344-30d5-42d7-ac5c-0ac356eea485","html_url":"https://github.com/Voyrox/SketchCalc","commit_stats":null,"previous_names":["frost-lord/sketchcalc","voyrox/sketchcalc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voyrox%2FSketchCalc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voyrox%2FSketchCalc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voyrox%2FSketchCalc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voyrox%2FSketchCalc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voyrox","download_url":"https://codeload.github.com/Voyrox/SketchCalc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252986836,"owners_count":21836236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["machine-learning","mathematics","neural-network","shapes","tensoflow"],"created_at":"2024-11-14T21:13:57.056Z","updated_at":"2025-05-08T02:31:44.737Z","avatar_url":"https://github.com/Voyrox.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SketchCalc\n\nSketchCalc is an interactive web application that allows users to draw mathematical expressions directly on a canvas. The application uses machine learning to predict the drawn symbols and converts them into a formal mathematical expression. It then evaluates the expression to provide the calculated answer.\n\n![SketchCalc Preview](./img/image.png)\n\n## Features\n\n- **Drawing Canvas**: Users can draw mathematical symbols and expressions on a canvas using mouse input.\n- **Real-time Prediction**: The application predicts the drawn symbols and converts them into mathematical notation.\n- **Bounding Box Calculation**: Drawn symbols are enclosed in bounding boxes to isolate individual symbols.\n- **Integration and Differentiation**: Supports integral and differential calculus with custom variables.\n- **Evaluation**: The predicted mathematical expressions are evaluated to provide the answer.\n- **Custom Variables**: Users can include custom variables in their expressions.\n- **Elapsed Time Measurement**: The time taken to parse and evaluate the drawing is displayed.\n\n## How It Works\n\n1. **Drawing**: Users draw mathematical expressions on the canvas.\n2. **Path Storage**: The paths of the drawings are stored and processed to determine bounding boxes.\n3. **Prediction**: Each bounding box is sent to a server that uses a machine learning model to predict the symbol.\n4. **Display**: The predicted symbols are displayed on the canvas.\n5. **Calculation**: The final expression is evaluated, and the result is displayed to the user.\n\n## Example Usage\n\n- Draw an integral on the canvas, and the application will recognize it as an integral symbol, convert it to the proper mathematical notation, and calculate the result.\n- Use custom variables in your expressions to evaluate them dynamically.\n\n## Technology Stack\n\n- **Frontend**: JavaScript, HTML5 Canvas, CSS\n- **Backend**: Flask (for prediction API)\n- **Machine Learning**: TensorFlow\n\n## Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/Frost-Lord/SketchCalc.git\n    cd SketchCalc\n    ```\n2. Download the model and dataset\n    ```bash\n    https://drive.google.com/drive/folders/1u9L_ByfnE8vfx2AMju7VChWGTsQkbbgm?usp=sharing\n    Extract \"model.keras\" to -\u003e ./\n    Extract \"dataset\" to -\u003e ./\n    ```\n3. Install dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n4. Run the server:\n    ```bash\n    python web.py\n    ```\n5. Open `index.html` in your browser to start drawing and calculating.\n\n\n# Dev Notes:\n\n## Testing on Windows\n```bash\n# Create a new virtual environment\npython -m venv venv\n\n# Activate the virtual environment\n.\\venv\\Scripts\\activate || source venv/bin/activate\n\n# Install Tensorflow\npython3 -m pip install tensorflow[and-cuda]\n\n# Keras to tflite\npython convert_to_tflite.py -i model.keras -o model.tflite\n```\n\n# Keras to WebModel\n```bash\npython KerasToWebModel.py\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVoyrox%2FSketchCalc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVoyrox%2FSketchCalc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVoyrox%2FSketchCalc/lists"}