How abdurrahim2705/cat-dog-app works
This is a cat-versus-dog image-classification application. A user selects an image in the React interface, previews it, and submits it to the FastAPI prediction endpoint; the endpoint decodes and preprocesses the image, runs the trained CNN, and returns a class and confidence for display. The graph separates the browser workflow, API/inference stages, and model artifact. The React-to-API request and inference behavior are visible in sampled source; other frontend details are represented only where supported by the excerpt.
Main entry points: app.py Prediction route · App.jsx Select and preview · main.jsx React mount · cat_dog_cnn.pth Trained weights
Components 8
Browser interface
- React mount
my-react-app/src/main.jsx - Select and preview
my-react-app/src/App.jsx - Upload and results
my-react-app/src/App.jsx
Prediction API
- Prediction route
app.py - Decode and transform
app.py
Classifier model
- Cat-dog CNN
app.py - Trained weights
cat_dog_cnn.pth
Other components
- Image user
Connections 8
- Image user → Select and preview: selects image
my-react-app/src/App.jsx - React mount → Select and preview: renders
my-react-app/src/main.jsx - Select and preview → Upload and results: provides selection
my-react-app/src/App.jsx - Upload and results → Prediction route: POSTs image
my-react-app/src/App.jsx - Prediction route → Decode and transform: decodes and transforms
app.py - Prediction route → Cat-dog CNN: runs inference
app.py - Cat-dog CNN → Trained weights: loads parameters
app.py - Prediction route → Upload and results: returns prediction
app.py