Giter Site home page Giter Site logo

dogbreeds's Introduction

Project: Use a Pre-trained Image Classifier to Identify Dog Breeds

Screenshot from 2023-11-05 15-44-50

Image classifier to identify dog breeds by drawing upon libraries and automating scripts to solve complex problems quickly. This project was part of the AI-Programming with Python Nanodregree by Udacity.

Objective

  • Determine the correct identification of images with dogs, regardless of breed misclassification, and distinguish non-dog images.
  • Accurately classify the breed of dogs in the identified dog images.
  • Evaluate which convolutional neural network (CNN) architecture, such as ResNet, AlexNet, or VGG, is the most effective for achieving both of these objectives.
  • Factor in the time and computational resources required to achieve these objectives optimally, and assess if there are alternative solutions that can yield sufficiently accurate results within a more reasonable time frame.

Specifications

Timing Code

Implementing Time functions.

Command Line arguments

Enable arch argument

adds command line argument for '--arch' default='vgg'

Enable dogfile argument

adds command line argument for '--dogfile' default='dognames.txt'

Enable dir argument

python check_images.py --dir pet_images/

Pet Image Labels

Correct Function Call

'in_arg.dir' is passed as an argument inside check_images.py while calling the get_pet_labels function.

Handling hidden files

These files can be useful for system configuration, considering them as regular input files could cause potential bugs in your program as it scales. Moreover, the origin of such bugs is often difficult to trace due to the hidden status of these files.

results_dic = dict()


    for imagefile in listdir(image_dir):  
        emptystr = " "
        namelist = imagefile.lower().strip().split(".")[0].split("_")
        cleanimagefile = emptystr.join([str(item) for item in namelist if item.isalpha()])
        results_dic[imagefile] = [cleanimagefile]
            
    
    return results_dic

Dictionary returned is in the correct format.

Dictionary key and label  retrieves 40 key-value pairs. e.g:- {'Poodle_07956.jpg': ['poodle'], 'fox_squirrel_01.jpg': ['fox squirrel'] ... }

Classifying Images

Correct Function Call Appends images_dir to each value before making the function call.

classifier(images_dir+users_key, model)

Output Formatting Convert the output to lower case and strip any whitespaces

Verifies and stores results in appropriate way. Displays output when the function call is made. Appends 1 to correct label, and 0 to falsely classified values

Classifying Labels as Dogs

Matches between Classifier and Pet Image Labels have both labels classified as "dogs" or "not dogs" as appropriate for the labels.

Non-matches between Classifier and Pet Image Labels correctly classify each label as "dogs" or "not dogs"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.