项目作者: ALLCAPSDEV

项目描述 :
CLI for creating CSV files for Cloud Vision API
高级语言: TypeScript
项目地址: git://github.com/ALLCAPSDEV/cvcsv-cli.git
创建时间: 2019-08-31T15:16:24Z
项目社区:https://github.com/ALLCAPSDEV/cvcsv-cli

开源协议:MIT License

下载


cvcsv-cli

Language grade: JavaScript Maintainability Test Coverage

@allcapsdev/cvcsv-cli"">npm Commitizen friendly FOSSA Status

ko-fi

This is a tool to make the process of creating the bulk import CSV file for Google Clouds Vision Product Search API a little easier.

Here is the documentation for the formatting the CSV.

Prerequisites

  • Node
  • The data should be organised as follows:

    1. .
    2. ├── kitkat
    3. └── chunky
    4. ├── peanut_butter
    5. ├── 01.jpg
    6. ├── 02.jpg
    7. ├── plain
    8. ├── 01.jpg
    9. ├── 02.jpg
    10. ├── salted_caramel
    11. ├── 01.jpg
    12. ├── 02.jpg
    13. ├── 03.jpg
    14. └── white
    15. └── 01.png

How to use

  1. npm i -g @allcapsdev/cvcsv-cli

Note: The package is published to Github Package Registry follow these instructions in order to be able to install this package and others from there. (It is also available via NPMJS)

Then once the package has been installed:

  1. cvcsv

The CLI will then ask a few questions relating to the data, i.e. where it is, the GCP bucket name, etc.

The output file will be created in the directory that you provide as the source of the images you wish to add to the csv.

asciicast

Config File

The CLI will read a config file from within the directory that it is executed.

The file should be named .cvcsvrc and the structure is as follows:

  1. {
  2. "bucketName": "the-name-of-the-gs-bucket-the-sample-images-are-stored",
  3. "category": false,
  4. "csvFileLocation": "where-you-would-like-to-save-the-csv-file",
  5. "csvFilename": "the-name-of-the-file.csv",
  6. "productCategory": "any-of-the-product-categories-GCP-CV-has",
  7. "productSet": "the-name-of-your-product-set",
  8. "rootDirectory": "the-root-directory-of-your-images"
  9. }

You can complete the whole file or you can miss any of the fields out, the CLI will ask you for any that are missing.

category can be false or a number. The number relates to the directories below the root directory. Using the example above kitkat would be 0, chunky = 1, etc.

If no file is there then you will get the full set of questions.