Git Product home page Git Product logo

sunanalytics's Introduction

Sun-Analytics-Dog-Matcher


This simple application gets a dog image after analyzing it with "TensorFlow-mobilenet" API detects the breed and can grab same breed images from the "DOG API".


Description

This is a front end Dog image matcher, which supports the following use cases:

Project’s main requirements according to the assignment:

  • Uploading a dog image on the browser, including showing a preview
  • Match the image via TensorFlow-mobilenet API
  • Calling the Dog API using info generated with TensorFlow
  • Display all matching images with lazy loading option
  • Routing is done via vue-router
  • UI is built from scratch
  • Uses Tailwind for styling
  • Works properly with the latest version of Chrome
  • Wrote one sample test for "OperationButtons" component

Extra features on top of the main requirements:

  • It’s fully responsive

  • Some basic UI components such as header, footer, hero image, etc are also implemented to provide a smoother look and feel from UI/UX perspective

  • Popular breeds: Images can be listed based on the Dog's breed, via clicking on the respective link in the footer

  • “Back to top” button is provided alongside with the lazy loading, to provide better user experience after too many scrolls

  • File type validation is implemented (jpeg, png, etc) , showing proper message when the error is detected

  • File size validation is implemented (1MB threshold) , showing proper message when the error is detected

  • If the uploaded image is not a dog’s image, proper message is shown

  • It shows the number of matches found, so that the users would have some idea before they do all the scrolling

  • The accuracy of the classification is also shown to the user based on the API’s result.

  • The breed search is not only applied on the main breed, but also on the sub breeds as well, to increase the accuracy of the classification.

    • Application is deployed in Netlify

Demo

  • For demo click Demo

Licence

  • MIT

Contacts


Project setup

yarn install

Compiles and hot-reloads for development

yarn serve

Compiles and minifies for production

yarn build

Lints and fixes files

yarn lint

Customize configuration

See Configuration Reference.


API


Code description and approach

FrameWork

I decided to proceed with "VueJs" mainly because at the moment I have more confidence in it. On top of that, to the best of my knowledge it is the simplest one to maintain in the future. Also it recently moved on to V3 without conflicting with the old versions which shows the developers are doing a good job to make it reliable. But in the end it is just a framework built on Javascript that can be easily replaced with any other one.

Code structure

I’ve used mixins and directives to make my code reusable and shorten my components.

  • The main component is the "ImageUpload" component, which essentially contains the main functionality of the app. It contains the main app data and uses other components to generate the application.

  • "App" and "Home" components mostly take care of the general view, header and footer sections.

  • "lazyLoad" directive is a logic that I’ve attached to images in order to show them in the lazy loading option. I’ve used that in the "ViewImage" component which basically gets the URL and previews the image.

  • Mixins are consist of four logics:

    • "getFile" logic is for grabbing the image file from the browser and checking for errors like file-type and file-size, and putting errors in the "uploadedImageValidation" object. Also it prevents uploading incorrect ones.

    • "createImage" gets a file from "getFile" and creates an image and also calls for "TensorFlow" API and and put API's info into array then calls "mainBreedSearch".

    • "mainBreedSearch" logic is responsible for searching breeds and subBreeds for the info from TensorFlow in the breeds object which came from DogApi at the created hook. Also it generates possible errors in "uploadedImageValidation" object.

    • "getDogs" is a re usable logic for calling GogAPI to get breed/subBreed images.

Also I’ve aimed to add ample comments in the code.


sunanalytics's People

Contributors

gagiknav avatar

Watchers

 avatar

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.