--- license: mit pipeline_tag: image-classification --- # Finetuned ResNet Model for Park Image Classification ## Overview This model is a finetuned ResNet model that has been trained on images from a local park in Pleasanton. ## Dataset The training dataset consists of two classes: "Sierra Redwood" and "Coastal Redwood". The dataset contains images captured within the park in Pleasanton. ## Model Architecture The model architecture used for this classification task is ResNet-50. ## Usage To use this model, you can follow these steps: 1. Install the required dependencies, including PyTorch and torchvision. 2. Download the model file "resnet_park_redwood_finetuned.tar.gz" from the provided link. 3. Load the model using the `torch.load` function and extract the model weights. 4. Prepare your input image by resizing it to 224x224 pixels and applying the necessary transformations (e.g., normalization). 5. Pass the preprocessed image through the model to obtain the predicted class probabilities. 6. Optionally, apply softmax to the predicted probabilities to obtain normalized scores. 7. The model will output the predicted label (Sierra Redwood or Coastal Redwood) along with the corresponding probability scores. ## Example Code Here's an example code snippet for using the finetuned ResNet model: ```python from transformers import AutoModelForImageClassification, AutoImagePipeline model_name = "resnet_c_s_redwood_finetuned" image_path = "path/to/your/image.jpg" # Load the pre-trained model model = AutoModelForImageClassification.from_pretrained(model_name) # Create an image classification pipeline classifier = AutoImagePipeline(model=model, model_name=model_name) # Perform image classification result = classifier(image_path) # Print the predicted label predicted_label = result[0]['label'] print(predicted_label) ```