Files
deep-learning-flower-classi…/README.md
T
2025-10-12 18:07:55 +08:00

2.3 KiB

Deep Learning Flower Classification

This repository contains implementations of various deep learning models for classifying flower images.

Models Included

The following models are implemented in this repository:

Data

The project uses flower image data located in:

  • data/flower_data/: Processed data for training and validation.
  • data/flower_photos/: Original flower photos.

Note: Data and pre-trained model weights are excluded from the repository via the .gitignore file.

Project Structure

Each model resides in its own directory (e.g., DenseNet/, EfficientNet/). Within each model's directory, you will typically find:

  • model.py: Defines the model architecture.
  • train.py: Script for training the model.
  • evaluate.py: Script for evaluating the trained model.
  • predict.py: Script for making predictions on new images.
  • my_dataset.py: Defines the custom dataset loading logic.
  • utils.py: Contains utility functions.
  • class_indices.json: Maps class indices to class names.

Usage

  1. Clone the repository:

    git clone https://github.com/xixu-me/deep-learning-flower-classification.git
    cd deep-learning-flower-classification
    
  2. Prepare Data: Ensure the required datasets are present in the data/ directory as expected by the scripts.

  3. Install Dependencies: Install necessary Python libraries (e.g., PyTorch, torchvision, numpy, matplotlib). Consider adding a requirements.txt file.

  4. Navigate to a Model Directory:

    cd DenseNet/ # or EfficientNet/, GoogLeNet/, Transformer/
    
  5. Train:

    python train.py # Add necessary arguments
    
  6. Evaluate:

    python evaluate.py # Add necessary arguments
    
  7. Predict:

    python predict.py --image_path <path_to_image> # Add necessary arguments
    

Refer to the specific scripts within each model directory for detailed usage instructions and available arguments.

License

Copyright © Xi Xu

Licensed under the GPL-3.0 license.