Downloads · 30 days
0
LucasNgHW/AAI3001-ObjectDetection
AAI3001-ObjectDetection is a machine learning model from LucasNgHW. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Follow these steps to run the application successfully. The app will NOT run if any step is skipped or done out of order.
Downloads · 30 days
0
Access
Public
Updated Nov 27, 2025
Repo size
857 MB
Likes
0
Public
Click a slice to open those files.
.pth473 MB · 55%
From the Hugging Face model README
Follow these steps to run the application successfully. The app will NOT run if any step is skipped or done out of order.
It is highly recommended to isolate dependencies.
Mac / Linux
python3 -m venv venv
source venv/bin/activate
Windows
python -m venv venv
venv\Scripts\activate
You must see the (venv) prefix in your terminal before continuing.
You MUST install using the provided requirements.txt:
pip install --upgrade pip
pip install -r requirements.txt
This installs:
app.py and app2.pyIf installation fails, ensure you have Python 3.9–3.11.
Start the Flask app using:
python app.py
You should see output similar to:
* Running on http://127.0.0.1:5000 (Press CTRL+C to quit)
Once the server is running:
http://127.0.0.1:5000
You should now see the full Fruit Detection interface, including:
app.py for Hugging Face)If you are running the Gradio version instead of Flask, use:
python app.py
You will see a Gradio URL such as:
Running on http://127.0.0.1:7860
Open that link to use the hosted interface.
To safely stop the server:
The dataset consists of 1,504 fruit images across 10 fruit classes. Data was collected through a combination of self-annotation and external sources to ensure class balance and diversity.
A total of 1504 images were annotated manually using LabelImg, of which contains around 100 images per class that were filtered from our previously collected dataset used in the first half of the project on fruit classification.
To increase variability and representation, 300 additional images were sourced from multiple Kaggle datasets.
Only images that matched the 10 fruit classes were included.
All imported images were:
Below are the Kaggle datasets referenced (insert actual links in the placeholders):
Dataset Source 1
Fruit Images for Object Detection: https://www.kaggle.com/datasets/mbkinaci/fruit-images-for-object-detection
Notes: 300 images of apple, banana and orange were taken from this dataset
Dataset Source 2
Fruit Detection Dataset: https://www.kaggle.com/datasets/lakshaytyagi01/fruit-detection
Notes: 150 images of watermelon were taken from this dataset
To ensure robust model evaluation and fair representation across classes, the dataset underwent stratified train/validation splitting and class balancing:
After splitting:
Final training data features a balanced number of labeled objects per class, maximizing fairness and reliability in model learning.