How arenan02/object-counter works
This Flask object-counter accepts an uploaded image and confidence threshold, obtains detections, filters and counts them, updates cumulative counts, and returns current and total counts. The CLI offers a separate invocation of the same domain action. Configuration selects fake in-memory adapters or real TensorFlow Serving and MongoDB adapters. The graph follows the sampled calls and README-described service boundaries; the internals of unsampled resources and integrations are not inferred beyond the documented or visible connections.
Main entry points: actions.py Count Action · config.py Adapter Configuration · models.py Domain Models · object_detector.py TensorFlow Detector
Components 15
Entrypoints
- Flask API
counter/entrypoints/webapp.py - CLI Runner
counter/entrypoints/main.py
Counting Domain
- Count Action
counter/domain/actions.py - Filter and Count
counter/domain/predictions.py - Domain Models
counter/domain/models.py - Adapter Ports
counter/domain/ports.py - Debug Image Output
counter/debug.py
External Adapters
- Adapter Configuration
counter/config.py - Fake Detector
counter/adapters/object_detector.py - TensorFlow Detector
counter/adapters/object_detector.py - In-Memory Counts
counter/adapters/count_repo.py - Mongo Counts
counter/adapters/count_repo.py
Other components
- API Client
- TensorFlow Serving
- MongoDB
Connections 24
- API Client → Flask API: uploads image
README.md - Flask API → Adapter Configuration: gets action
counter/entrypoints/webapp.py - Flask API → Count Action: executes count
counter/entrypoints/webapp.py - CLI Runner → Adapter Configuration: gets action
counter/entrypoints/main.py - CLI Runner → Count Action: executes count
counter/entrypoints/main.py - Adapter Configuration → Count Action: constructs
counter/config.py - Adapter Configuration → Fake Detector: selects in dev
counter/config.py - Adapter Configuration → In-Memory Counts: selects in dev
counter/config.py - Adapter Configuration → TensorFlow Detector: selects in prod
counter/config.py - Adapter Configuration → Mongo Counts: selects in prod
counter/config.py - Count Action → TensorFlow Detector: predicts via port
- Count Action → Filter and Count: filters and counts
counter/domain/actions.py - Count Action → Debug Image Output: draws debug images
counter/domain/actions.py - Count Action → In-Memory Counts: updates and reads
- Count Action → Mongo Counts: updates and reads
- Count Action → Domain Models: builds response
counter/domain/actions.py - Filter and Count → Domain Models: uses domain types
counter/domain/predictions.py - Fake Detector → Domain Models: returns predictions
counter/adapters/object_detector.py - TensorFlow Detector → Domain Models: maps predictions
counter/adapters/object_detector.py - TensorFlow Detector → TensorFlow Serving: requests predictions
counter/adapters/object_detector.py - In-Memory Counts → Domain Models: stores counts
counter/adapters/count_repo.py - Mongo Counts → Domain Models: maps counts
counter/adapters/count_repo.py - Mongo Counts → MongoDB: reads and writes
counter/adapters/count_repo.py - Adapter Ports → Domain Models: defines data types
counter/domain/ports.py