Polygon

    Polygon V0.1.1

  • Installation
  • Configuring Cli
  • Polygon Cli Commands
  • Container
  • Add Container
  • Container Details
  • Delete Container
  • Dataset
  • List Dataset
  • Create Dataset
  • Merge Datasets
  • Delete Dataset
  • Download Dataset
  • Dataset Details
  • Assign Dataset
  • Create Version
  • Admin
  • Add User
  • Edit User
  • Get Users
  • Delete User
  • Query
  • Sql
  • No sql

Install

  • System requirements :
    • Operating system : Ubuntu 16.04 or higher
    • Python version : python 3.6 or higher
  • Run the below command to install the polygon cli
    • sudo pip3 install viena-polygon
    • wget https://viena.ai/assets/polygon
    • sudo cp polygon /usr/local/bin
    • sudo chmod +x /usr/local/bin/polygon

Configure the cli

  • Steps to generate the "API KEYS"
    • Login to the  polygon.viena.ai with the administrator credentials
    • Click on the tab "ADMIN CONSOLE"
    • Select the permissions i.e "Read","Write","All"
    • Click on the "GENERATE API KEY"
    • Generated API key will be displayed below
    • Now run polygon --configure from terminal to configure the cli

List of cli commands

Add Container

  • Execute below command to add the AWS s3 bucket with account authentication
    • polygon container add --cloudstoragename="<name for cloud storage (users choice)>" --cloudtype="aws_s3" --authentication="account_authentication" --bucketname="<aws s3 bucket name>" --accesskey="<aws account secret key>" --secretid="<aws account secret ID>" --region="<region which the bucket belongs to>"
      • cloudstoragename : Name for cloud storage (users choice)
      • cloudtype : For aws cloud type is "aws_s3"
      • authentication : Type of authentication "account_authentication"
      • bucketname : Aws s3 bucket name
      • accesskey : Aws account access key
      • secretid : Aws account secret ID
      • region : Region which aws s3 bucket belongs
  • Execute below command to add the AWS s3 bucket with anonymous access
    • polygon container add --cloudstoragename="<name for cloud storage (users choice)>" --cloudtype="aws_s3" --authentication="anonymous_access" --bucketname="<aws s3 bucket name which has public access>" --manifestjson="manifest.json" --region="<region which the bucket belongs to>"
      • cloudstoragename : Name for cloud storage (users choice)
      • cloudtype : For aws cloud type is "aws_s3"
      • authentication : Type of authentication "anonymous_access"
      • bucketname : Aws s3 bucket name which has public access
      • manifestjson : Name of the manifestjson file bucket
      • region : Region which aws s3 bucket belongs
  • Execute below command to add the azure container with anonymous access
    • polygon container add --cloudstoragename="<name for cloud storage (users choice)>" --cloudtype="azure_container" --authentication="anonymous_access" --containername="<azure container name with anonymous access of read list>" --accountname="<Name of the account which container belongs to>"
      • cloudstoragename : Name for cloud storage (users choice)
      • cloudtype : For azure container cloud type is "azure_container"
      • authentication : Type of authentication "anonymous_access"
      • containername : Azure container name with anonymous access of read list
      • accountname : Name of the account which container belongs to

Container Details

  • Execute below command to get the container details in the account
    • Container details using cloud storage Id
      • polygon container details --cloudstorageid="<container id to get the details>"
      • cloudstorageid : Container id to get the details
    • Container details using cloud storage name
      • polygon container details --cloudstoragename="<container name to get the details>"
      • cloudstoragename : Container name to get the details

Delete Container

  • Execute below command to delete the container in the account
    • Container delete using cloud storage Id
      • polygon container delete --id="<container id to be delete>"
      • id : Container id to be delete
    • Container delete using cloud storage name
      • polygon container delete --name="<container name to be delete>"
      • name : Container name to be delete

    List Dataset

    • Execute below command to get list of datasets in the account
      • polygon dataset list

Create Dataset

  • Execute below command to create the dataset in the account
    • polygon dataset create --name="<dataset name>" --clodustoragename="<name of the container added>" --classname="<class names separated by comma>"
      • name : Name of the dataset to create
      • clodustoragename :Name of the container storage from which dataset has to create
      • classname :Class names separated by comma

Merge Dataset

  • Execute below command to merge the dataset(s) in the account
  • Note:Only datasets with same class names can be merged.
    • Dataset merge using dataset Id
      • polygon dataset merge --datasetid="<Dataset id’s to merge separated by comma>" --name="<Name for the merged dataset>"
      • datasetid : Dataset Id's to be merged separated by comma
      • name :Name for the merged dataset
    • Dataset merge using dataset name
      • polygon dataset merge --datasetname="<Dataset name’s to merge separated by comma>" --name="<Name for the merged dataset>"
      • datasetname : Dataset name's to be merged separated by comma
      • name :Name for the merged dataset

Delete Dataset

  • Execute below command to delete the dataset in the account
    • Delete dataset using datdaset Id
      • polygon dataset delete --id="<Dataset id to be delete>"
      • id : Dataset Id to be delete
    • Delete dataset using datdaset name
      • polygon dataset delete --name="<Dataset name to be delete>"
      • name : Dataset name to be delete

Download Dataset

  • Execute below command to download the dataset in the account
    • Download dataset using dataset Id
      • polygon dataset download --datasetid="<Dataset id to be downloaded>" --filters ="<Filters separated by comma (annotated,approved,redo)>" --format="<Download format coco or yolo>"
      • datasetid : Dataset Id to be downloaded
      • filters : Filters separated by comma (annotated,approved,redo)
      • format : Download format coco or yolo
    • Download dataset using datdaset name
      • polygon dataset download --datasetname="<Dataset name to be downloaded>" --filters ="<Filters separated by comma (annotated,approved,redo)>" --format="<Download format coco or yolo>"
      • datasetname : Dataset name to be downloaded
      • filters : Filters separated by comma (annotated,approved,redo)
      • format : Download format coco or yolo

Dataset details

  • Execute below command to get the dataset details in the account
    • Dataset details using datdaset Id
      • polygon dataset details --id="<Dataset id to get the details>"
      • id : Dataset id to get the details
    • Dataset details using datdaset name
      • polygon dataset details --name="<Dataset name to get the details>"
      • name : Dataset name to get the details

Assign Dataset

  • Execute below command to assign the dataset to users
    • polygon dataset assigndataset --email="<email of the user to assign>" --datasetid="<Dataset id's to assign separated by comma>"
      • email : Email of the user to assign
      • datasetid : Dataset id's to assign separated by comma

Create Version

  • Execute below command to create the version from the dataset
    • polygon dataset version --filters="<Filter names to be applied separated by comma>" --datasetid="<Dataset Id from which version will create>" --name="<Custom name for version >"
      • filters : Filter names separated by comma
      • (Available filters: blur,horizontalflip,verticalflip,hue,greyscale)
      • datasetid : Dataset Id from which version will create
      • name : Custom name for the version

Add User

  • Execute below command to add user to account
    • polygon adduser --name="<name of the user>" --email="<email of the user>" --password="<password to login>" --role="<assign role admin or dataset to user>"
      • name : Name of the user
      • email : Email of user
      • password : Password to login
      • role : Assign role admin or dataset to user

Edit User

  • Execute below command to edit user in the account
    • polygon edituser --email="<email of the user to update role>" --role="<assign role admin or dataset to user>"
      • email : Email of user to update role
      • role : Assign role admin or dataset to user

Get Users

  • Execute below command to get users in the account
    • polygon getusers

Delete User

  • Execute below command to delete user in the account
    • polygon deleteuser --email="<email of the user(s) to delete separated by comma>"
      • email : Email of the user(s) to delete separated by comma

Sql

  • Below are the tables that can be queried
  • image, dataset, annotation, training_set, version, training_data
  • Execute below command to enter into sql mode
  • polygon query
    • Sql query example:
      • select * from image
      • select * from dataset limit 5
      • select objectName from annotation
      • select name,datasetId from dataset where active=1
      • select datasetId from image where datasetId='<Dataset ID>' | more
    • Apply Filters to dataset and download:
      • select * from images where datasetname='<Dataset Name>' | blur --percentage="5" | download
      • select * from images where datasetname='<Dataset Name>' | verticalflip | download
      • select * from images where datasetname='<Dataset Name>' | horizontalflip | download
      • select * from images where datasetname='<Dataset Name>' | grayscale | download
      • select * from images where datasetname='<Dataset Name>' | upscale --percentage="80" | download

No Sql

  • Below are the tables that can be queried
  • image, dataset, annotation, training_set, version, training_data
  • Execute below command to enter into sql mode
  • polygon query
    • NoSql query example :
      • db.image.find({'datasetId':''})
      • db.dataset.find({'name':''})
      • db.image.count({'name':''})
      • db.annotation.find({'objectName':''})




VienaBeta

    Viena DB V0.1.1

  • Installation
  • Configuring Cli
  • Add GCP Container
  • Cli Comands List
  • Configure From Admin
  • Viena SDK
  • Add Cloud Container
  • Get Logs
  • Get VideoID
  • Get Summary Details by Videoid
  • Get Summary Details by Video Path
  • Get Frame Details

Install

  • Run the below command to install the vienadb cli
    • sudo pip3 install viena
    • wget http://viena.ai/viena/assets/viena
    • sudo cp viena /usr/local/bin
    • sudo chmod +x /usr/local/bin/viena

Configure the cli

  • Steps to generate the "API KEYS"
    • Login to the  aperion.viena.ai with the administrator credentials
    • Click on the tab "API Keys"
    • Select the permissions i.e "Read","Write","All"
    • Click on the "GENERATE API KEY"
    • Generated API key will be displayed below
  • Now run viena --configure from terminal to configure the cli
  • Add GCP cloud container details

    • Run the below command to add the gcp cloud details
      • viena add --configfile="< absolute path of the config json file >"
        • Below is the config file format
       {
        "actions": {
          "meta": true,
          "ai": [
            "nsfw",
            "blur", 
      	  "vice",
            "weapons",
      	  "ocr"
          ]
        },
        "results_endpoint":"http://restapiexample.com/postdata",
        "container": {
          "name": "test2",
          "type": "gcp",
          "bucket_name":"account2-bucket",
          "config_json": {
            "type": "service_account",
            "project_id": "test-1307",
            "private_key_id": "b8c29dfdfdfg6a9derta8da573ea3",
            "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBAD ZBoroPAilabVpR9jOvZ7AvdvAQ5lb01Z1Q1tGoZRFGT0d7\new1qe6XXRb+NAzOTitcOyAMfj5LJjOPqeAES7fN2mohr2O2nj7BVz+l8FON5D5b0\nVT35klOMETIdnu6jeDj6+g==\n-----END PRIVATE KEY-----\n",
            "client_email": "test-1307@appspot.gserviceaccount.com",
            "client_id": "",
            "auth_uri": "https://accounts.google.com/o/oauth2/auth",
            "token_uri": "https://oauth2.googleapis.com/token",
            "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
            "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/kube-test-1307%40appspot.gserviceaccount.com"
          }
        }
      }  
    • results_endpoint Rest endpoint to post of your choice to the data
    • name Custom name of your choice to display in UI
    • type Type of the cloud storage (aws/gcp/azure)
    • bucket_name: Name of the bucket which you are adding
    • config_json: Refer this  link to download credential json and replace the values.

    List of cli commands

    • Execute below command to get the logs
      • viena logs
    • Execute below command to get the videoId of the videos uploaded from bucket
      • viena getvideoid
    • Execute below command to get summary details of the video
      • viena summarydetails --videoid="< generated videoId in db >"
      • viena summarydetails --videopath="< absolute path of the video in the bucket >"
        • Run viena getvideoid to get the videoid and videopath

    Configure from admin

    • Generate the "API KEYS"
      • Login to the  aperion.viena.ai with the administrator credentials
      • Click on the tab "API KEYS"
      • Select the permissions i.e "Read","Write","All"
      • Click on the "GENERATE API KEY"
      • Generated API key will be displayed below
    • Add the "CONFIGURATION"
      • Click on the tab "CONFIGURATION"
      • Select the meta and the required Artificial Intelligence (AI)from the list
      • Add the rest results endpoint
      • Click on the "GENERATE CONFIGURATIONS"
    • Add the "CLOUD STORAGE"
      • Click on the "ADD CLOUD STORAGE"
        • Add the "Display Name"
        • Select the "Cloud Provider" from the dropdown list (AWS S3/Azure Container/Google Cloud Storage)
        • Add the "Bucket Name" which belongs to the selected cloud provider
        • Add the "Config JSON"
        •  {
            "actions": {
              "meta": true,
              "ai": [
                "nsfw",
                "blur", 
          	  "vice",
                "weapons",
          	  "ocr"
              ]
            },
            "results_endpoint":"http://restapiexample.com/postdata",
            "container": {
              "name": "test2",
              "type": "gcp",
              "bucket_name":"account2-bucket",
              "config_json": {
                "type": "service_account",
                "project_id": "test-1307",
                "private_key_id": "b8c29dfdfdfg6a9derta8da573ea3",
                "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBAD ZBoroPAilabVpR9jOvZ7AvdvAQ5lb01Z1Q1tGoZRFGT0d7\new1qe6XXRb+NAzOTitcOyAMfj5LJjOPqeAES7fN2mohr2O2nj7BVz+l8FON5D5b0\nVT35klOMETIdnu6jeDj6+g==\n-----END PRIVATE KEY-----\n",
                "client_email": "test-1307@appspot.gserviceaccount.com",
                "client_id": "",
                "auth_uri": "https://accounts.google.com/o/oauth2/auth",
                "token_uri": "https://oauth2.googleapis.com/token",
                "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
                "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/kube-test-1307%40appspot.gserviceaccount.com"
              }
            }
          }  
        • results_endpoint Rest endpoint to post of your choice to the data
        • name Custom name of your choice to display in UI
        • type Type of the cloud storage (aws/gcp/azure)
        • bucket_name: Name of the bucket which you are adding
        • config_json: Refer this  link to download credential json and replace the values.

    Viena SDK

    • Run the below command to install the Viena SDK cli
      • sudo pip3 install viena-sdk

    Add Cloud Container

    • Container can be added even using the viena sdk. Below is the code snippet to add the container
    • Click  here to download sample config json
      • Once the config.json is downloaded replace the following parameters according to your cloud details
      • results_endpoint Rest endpoint to post of your choice to the data
      • name Custom name of your choice to display in UI
      • type Type of the cloud storage (aws/gcp/azure)
      • bucket_name: Name of the bucket which you are adding
      • config_json: Refer this  link to download credential json and replace the values.
      • import viena_sdk
        
        apikey="Pass the API key"	
        configjson="Full path of config json"	
        					   
        add_details=viena_sdk.addCloudContainer(apikey,configjson)
        print(add_details)				   
         
         
      • apikey : API Key of the aperion account which cloud details has to be added
      • configjson : Absolute Path of the config json
      • Click  here to download sample python script

    Get Logs

    • Get the server logs from viena sdk. Below is the code snippet to get the logs.
      • import viena_sdk
        
        apikey="Pass the API key"			   
        logs=viena_sdk.getlogs(apikey)
        print(logs)
         
        					 
      • apikey : API Key of the aperion account which logs has to be retrieved
      • Click  here to download sample python script

    Get VideoID

    • Get the VideoID from viena sdk. Below is the code snippet to get the VideoID.
      • import viena_sdk
        
        apikey="Pass the API key"					   
        videoIds=viena_sdk.getvideoid(apikey)
        print(videoIds) 
        					 
      • apikey : API Key of the aperion account which videoIds has to be retrieved
      • Click  here to download sample python script

    Get Summary Details by Videoid

    • Get the Summary Details from viena sdk. Below is the code snippet to get the summary details by videoId.
      • import viena_sdk
        apikey="Pass the API key"
        videoId="Pass the videoId"					   
        summary=viena_sdk.getsummarydetailsById(apikey,videoId)
        print(summary)
        				 
      • apikey : API Key of the aperion account
      • videoId : videoId of the video which summary has to be retrieved (To get the videoId refer "Get VideoID")
      • Click  here to download sample python script

    Get Summary Details by Video Path

    • Get the Summary Details from viena sdk. Below is the code snippet to get the summary details by video path.
      • import viena_sdk
        
        apikey="Pass the API key"
        videopath="Pass the full video path"					   
        summary=viena_sdk.getsummarydetailsByPath(apikey,videopath)
        print(summary) 
        					 
      • apikey : API Key of the aperion account
      • videopath : Video path of the video which summary has to be retrieved
      • Example : if bucketname ="demo" and videofile name is "video1.mp4" then videopath="demo/video1.mp4"
      • Click  here to download sample python script