Coder Social home page Coder Social logo

dataset-auto-ml-generator's Introduction

A utility to generate a dataset from a collection of image folders. It detects the folder structure and generate the classes in the dataset based on the folder hierarchy. The final result is a bunch of images uploaded to the GCP storage and a csv file. This csv file is also uploaded and can be accessed from Auto ML to import the dataset.

How to use this?

  1. First, you need to install the following packages:
pip install --upgrade google-api-python-client google-cloud-storage fire
pip install -r requirements.txt
  1. Then, go to GCP credentials:

    GCP Credentials

    Then, select the service account in the menu:

    GCP Credentials Menu

    Then, create the key and download the key:

    GCP Service Account Key Creation

    Create a folder in the root directory called 'keys' and store the key there with the name 'api-key.json':

    GCP Key
  1. Create a bucket in GCP to store all the files.
  1. Build your dataset folder: Take into account that to train a class in Auto ML you need at least 10 images of a this class. The minimum recommended is 100 images. But you know the more the better.

    Dataset folder
  1. Run the generator:

    python generator.py --bucket_name="automl-testing-231805-vcm" --dataset_loc
    al_path="/Users/williamgomez/dogs_cats_dataset" --dataset_gcp_name="dogs_cats_dataset" --min_samples=10
    
    Code running
  1. Go to your bucket: You will find two folders, one with all the images uploaded (uploads) and the second one with the csv of the dataset. Bucket

    You can also see csv generate in a temp folder in the root directory:

    Bucket
  1. Import the dataset in Auto ML: Go to Auto ML UI and click in "NEW DATASET".

    Set a dataset name.

    Select a CSV file on Cloud Storage.

    Add the path of the csv in the storage.

    Bucket

    Select Enable multi-label classification when you have more hierarchy in the folders, e.g.

    • Dogs
      • Schnauzer (Minimum 10 images inside)
      • Golden Retriver (Minimum 10 images inside)
    • Cats
      • American Curl (Minimum 10 images inside)
      • American Shorthair (Minimum 10 images inside)

    You will end with a dataset with the following classes: Dogs, Cats, Schnauzer, Golden_Retriver, American_Curl, American_Shorthair

Once your dataset is imported, you will see your images labelled.

Labelled images

Now, you can train your models!

dataset-auto-ml-generator's People

Contributors

williamegomezo avatar

Stargazers

Jay avatar

Watchers

James Cloos 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.