The Animal Sales Application is a Python-based GUI tool designed to assist pet shops or animal breeders in managing sales and inventory. It uses image recognition to identify animal characteristics and matches them against a database of previous sales, helping to price new animals or find similar past sales.
- Image analysis for animal identification
- Customer selection and management
- Database searching with tiered matching (breed first, then coat characteristics)
- Order form population from image analysis or database matches
- Mock order saving functionality
Before you begin, ensure you have met the following requirements:
- Python 3.7 or higher
- SQLite3
- Tkinter (usually comes with Python)
- Pillow (PIL Fork) for image processing
- An Ollama server running with the llava:34b model for image analysis
-
Clone this repository:
git clone https://github.com/yourusername/animal-sales-application.git cd animal-sales-application
-
Install the required Python packages:
pip install -r requirements.txt
-
Ensure you have SQLite installed on your system.
-
Set up the Ollama server with the llava:34b model. Follow the instructions on the Ollama website for installation and model setup.
main.py
: The main application script with GUI implementationdatabase_operations.py
: Handles all database-related operationsimage_analysis.py
: Manages image analysis using the Ollama APImodels.py
: Contains Pydantic models for data structuresanimal_sales.db
: SQLite database file (you need to create this with appropriate schema)
-
Start the Ollama server with the llava:34b model.
-
Run the main application:
python main.py
-
Use the GUI to:
- Select a customer from the dropdown (or leave as "Any")
- Click "Select Image" to choose an animal image for analysis
- View matching sales results in the treeview
- Double-click a result to populate the order form
- Manually edit the order form as needed
- Click "Save Order" to (mock) save the order
The animal_sales
table should have the following structure:
CREATE TABLE animal_sales (
id INTEGER PRIMARY KEY,
date TEXT,
species TEXT,
breed TEXT,
size TEXT,
weight REAL,
coat_length TEXT,
coat_color TEXT,
price REAL,
client_name TEXT,
client_email TEXT
);
Ensure your animal_sales.db
file is set up with this schema before running the application.
Contributions to the Animal Sales Application are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/AmazingFeature
) - Make your changes
- Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Your Name - [email protected]
Project Link: https://github.com/shiftbug/catsanddogs