How nithin1729s/kannada-cnn works
Main components
• Model Training & Evaluation Component:
• CNN Model: This is built using TensorFlow/Keras.
• Jupyter Notebook: Located in the notebooks directory, which was used for training and evaluation of the model (e.g., Kannada_CNN.ipynb).
• The saved model file (backend/model/full_model.h5): Represents the trained CNN that’s loaded later for inference.
• Backend Component:
• FastAPI Service: Located within the backend/api directory (main.py, __init__.py). This API serves endpoints for predictions by loading and deploying the CNN model.
• Dependencies for the backend are listed in backend/requirements.txt.
• Frontend Component:
• Next.js Application: Found under the frontend directory including the pages (page.tsx), layout, and drawing components (CanvasDrawing.tsx).
• UI Components: Various React or TypeScript components (e.g., button.tsx) to construct the drawing interface.
• Utility libraries: Under frontend/lib.
• Configuration files for Tailwind CSS, ESLint, and Next.js indicate modern web design and development practices.
Inter-component relationships and interactions
• Data Flow:
• User Interaction: On the frontend, a user draws a Kannada letter on a canvas.
• API Request: The drawn image is transmitted from the Next.js frontend to the FastAPI backend.
• Model Inference: The backend then loads the pre-trained CNN (full_model.h5) and performs prediction.
• Response Delivery: The prediction result is sent back to the frontend where it is displayed.
• Training Pipeline:
• The CNN model training is performed offline (via Jupyter Notebook) and the resulting model file saved is later used by the API backend for inference.
Architectural and design principles
• Separation of Concerns: The project clearly separates model training (offline, notebook-based) from model inference (handled by FastAPI), and further decouples user-interface concerns (Next.js) from the service layer.
• Modern Web Tech Stack: Use of Next.js and Tailwind indicates a component-based approach and responsive UI practices.
• Deployment Considerations: Use of configuration and dependency files (package.json, requirements.txt) suggests that building a pipeline for CI/CD and deployment is straightforward.
Relevant technologies and frameworks
• Backend: Python, FastAPI, Uvicorn server.
• Model Training: TensorFlow, Keras (with data augmentation, CNN layers, and callbacks).
• Frontend: Next.js (React framework), TypeScript, Tailwind CSS.
• Additional Tools: Jupyter Notebook for training experiments, configuration files (ESLint, PostCSS) for ensuring code quality and styling.
Practical steps for the principal software engineer
• Document data flows: indicate that the trained model (full_model.h5) is loaded by the FastAPI backend which processes image inference requests coming from the Next.js frontend.
• You include all files or directories that represent configuration (such as the various JSON and config files in the frontend) as supporting components for building, linting, or styling.