{"id":20355781,"url":"https://github.com/zackproser/pytorch-mnist","last_synced_at":"2026-04-16T09:36:29.838Z","repository":{"id":250637703,"uuid":"834927505","full_name":"zackproser/pytorch-mnist","owner":"zackproser","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-29T02:30:53.000Z","size":24372,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-15T01:07:46.177Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zackproser.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-28T18:27:49.000Z","updated_at":"2024-07-29T02:30:56.000Z","dependencies_parsed_at":"2024-07-29T03:55:23.084Z","dependency_job_id":null,"html_url":"https://github.com/zackproser/pytorch-mnist","commit_stats":null,"previous_names":["zackproser/pytorch-mnist"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackproser%2Fpytorch-mnist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackproser%2Fpytorch-mnist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackproser%2Fpytorch-mnist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackproser%2Fpytorch-mnist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackproser","download_url":"https://codeload.github.com/zackproser/pytorch-mnist/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241889487,"owners_count":20037517,"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":[],"created_at":"2024-11-14T23:14:04.765Z","updated_at":"2026-04-16T09:36:24.815Z","avatar_url":"https://github.com/zackproser.png","language":"Python","readme":"# Neural Network Digit Recognizer\n\n![MNIST digit recognition](./img/pytorch-mnist-hero.webp)\n\nA Python project that trains a neural network to recognize hand-drawn digits between 0 and 9 using the MNIST dataset, and provides a FastAPI web service for predictions.\n\n## Overview\n\nThis project uses PyTorch to create and train a neural network for digit recognition. \n\n![MNIST digit recognition](./img/pytorch-mnist-neural-network.webp)\n\nThe trained model can accurately classify hand-drawn digits from the MNIST dataset. Additionally, it includes a FastAPI web service that allows users to make predictions on uploaded images and view sample test images with predictions.\n\n## Features\n\n- PyTorch-based neural network architecture\n- Training script with configurable hyperparameters\n- Evaluation metrics for model performance\n- Ability to save and load trained models\n- FastAPI web service for making predictions on uploaded images\n- Endpoint to view sample test images with predictions\n\n## Technology Stack\n\n- Python 3.x\n- PyTorch\n- FastAPI\n- Pillow (PIL)\n- NumPy\n- Matplotlib (for visualization)\n- Dataset: MNIST\n\n## How It Works\n\n1. The MNIST dataset is used to train the neural network model.\n2. The trained model is saved and can be loaded for predictions.\n3. A FastAPI web service provides two main endpoints:\n   - `/predict`: Accepts an uploaded image and returns the predicted digit.\n   - `/test_images`: Generates a plot of sample test images with predictions.\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.x\n- pip\n\n### Installation\n\n1. Clone the repository:\n   ```\n   git clone https://github.com/yourusername/mnist-digit-recognizer.git\n   cd mnist-digit-recognizer\n   ```\n2. Install dependencies:\n   ```\n   pip install -r requirements.txt\n   ```\n\n### Running the Web Service\n\nTo start the FastAPI web service, run:\n\n```\npython main.py\n```\n\nThe service will be available at `http://localhost:8000`.\n\n### API Endpoints\n\n- `POST /predict`: Upload an image file to get a prediction.\n- `GET /test_images`: View a plot of sample test images with predictions.\n\n## Usage\n\n### Making Predictions\n\nTo make a prediction on an image, send a POST request to `/predict` with the image file:\n\n```\ncurl -X POST -F \"file=@path/to/your/image.png\" http://localhost:8000/predict\n```\n\n### Viewing Test Images\n\nTo view sample test images with predictions, open the following URL in your browser:\n\n```\nhttp://localhost:8000/test_images\n```\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackproser%2Fpytorch-mnist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackproser%2Fpytorch-mnist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackproser%2Fpytorch-mnist/lists"}