Update time: 2025-06-29
A smart stray animal adoption platform that integrates LINE BOT and web technologies, combining image recognition, large language models (LLMs), and database + map visualization. Users can report stray animals, match potential adopters, and interact with a personalized rich menu via LINE.
- Python Version:3.12.9
- OS: Windows 10/11
- Package Source:
requirements.txt
python -m venv venv- CMD User:
venv\Scripts\activate- PowerShell User:
.\venv\Scripts\Activate.ps1pip install -r requirements.txtBefore running the application, open config.ini and complete the following fields:
[LINE]
CHANNEL_ACCESS_TOKEN = <your channel access token>
CHANNEL_SECRET = <your channel secret>
...If you plan to use the LINE BOT feature with a personalized rich menu, run the following script first:
python register_richmenu.pypython app.py📷 Image Recognition: Identify whether uploaded images are dogs, cats, or other.
🤖 LLM Integration: Automatically generate promotional descriptions using large language models.
📱 LINE BOT: Report and search for animals via personalized interaction and menu.
🗺️ Web Platform: Search shelters, view data dashboards, and visualize reports on a map.
🐶 Animal Matching: Discover and save potential animals for adoption.
🧩 Modular Design: Clean separation of backend logic, handlers, and utilities.
This platform combines the Oxford-IIIT Pet Dataset with our self-collected dataset, serving as the foundation for training and testing, supporting stray animal detection and shelter data integration:
-
Oxford-IIIT Pet Dataset
- 37 breeds in total: 12 cat breeds + 25 dog breeds
- Each image includes bounding boxes and segmentation masks
- Suitable for classification and detection tasks
-
Self-Collected Dataset
- Contains images of mixed-breed cats and dogs (stray animals) for closer alignment with real-world adoption cases
- Adds a new bird category to extend recognition beyond cats and dogs
- All images are manually annotated with bounding boxes in YOLO format
-
Usage in This Platform
- The YOLO model is trained on the following classes:
- Mixed-breed major categories:
cat,dog,bird - Oxford-IIIT Pet Dataset fine-grained categories (37 breeds):
Abyssinian, Bengal, Birman, Bombay, British_Shorthair, Egyptian_Mau, Maine_Coon, Persian, Ragdoll, Russian_Blue, Siamese, Sphynx, american_bulldog, american_pit_bull_terrier, basset_hound, beagle, boxer, chihuahua, english_cocker_spaniel, english_setter, german_shorthaired, great_pyrenees, havanese, japanese_chin, keeshond, leonberger, miniature_pinscher, newfoundland, pomeranian, pug, saint_bernard, samoyed, scottish_terrier, shiba_inu, staffordshire_bull_terrier, wheaten_terrier, yorkshire_terrier
- Mixed-breed major categories:
- The YOLO model is trained on the following classes:
📌 Official dataset source: Oxford-IIIT Pet Dataset
.
├── app.py # Main Flask server entry
├── config.ini # Configuration file (LINE & DB)
├── register_richmenu.py # Script to register LINE rich menu
├── requirements.txt # Python dependency list
├── README.md # Project documentation
│
├── data/ # (Optional) directory for external data
├── db/ # SQLite database files
│
├── src/ # Core backend logic
│ ├── db_utils.py # DB utility functions
│ ├── init_db.py # DB schema and init script
│ ├── linebot_app.py # Main LINE BOT logic
│ ├── line_menu.py # Rich menu generator
│ ├── login.py # (Optional) login system
│ ├── saved_animals.py # Saved animal handler
│ ├── settings.py # Read config.ini
│ ├── User.py # User structure
│ ├── handlers/ # Event handlers (e.g., postbacks)
│ └── utils/ # Tools
│
├── static/ # Static web resources (CSS, JS, images)
│ └── questions.json # JSON data for UI or quizzes
└── templates/ # HTML templates (e.g., index.html)