American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5:30 PM – AI / Machine Learning – Gamas

December 10, 2024 @ 5:30 pm - 6:30 pm

Today We Did
  1. We started a new project to be able to predict pet breed.
Homework
  1. Inside the new project “TUE-530-Pet-Breed”, inside extract_breed function, you want to change extract_breed function to return the breed along with CAT or DOG information. For example, for english_terrier, you want the function to return “DOG – english_terrier”. For, spinx cat, you want the function to return “CAT – spinx”.
  2. Add a new cell under “cat_vs_dog_model.show_batch()”, inside this new cell you want to use the new “cat_vs_dog_model” to predict the dog and cat images that you uploaded into your kaggle before and display the image and display the breed name. We did this in the Cat VS Dog project before but instead of showing breed name we show Cat or Dog on top of the image name. You need to modify that code to now show the breed name. Below is the code we did before to display the images that we uploaded. You need to change this code to produce the breedname on top of the image.
  3. folder_path = "/kaggle/input/gamas-pet-images-2"
    myimages = get_image_files(folder_path)
    
    for img in myimages:
    catordog = ""
    result = cat_vs_dog_model.predict(img)
    
    if result[0]=="False":
    cat_or_dog = "Dog"
    else:
    cat_or_dog= "Cat"
    
    img = PILImage.create(img)
    img.show(title=catordog)
    print(f"I am {result[2]} sure that this is a {catordog}")

Details

Date:
December 10, 2024
Time:
5:30 pm - 6:30 pm
Verified by MonsterInsights