Contents Menu Expand Light mode Dark mode Auto light/dark mode
TensorBay documentation
TensorBay documentation

Quick Start

  • Getting started with TensorBay
  • Examples
    • Dogs vs Cats
    • 20 Newsgroups
    • BSTLD
    • Neolix OD
    • Leeds Sports Pose
    • THCHS-30
    • VOC2012 Segmentation
    • CADC
    • Update Dataset
    • Move And Copy
    • Merge Datasets
    • Get Label Statistics

Features

  • Dataset Management
  • Version Control
    • Getting Started with Version Control
    • Draft and Commit
    • Branch
    • Tag
    • Diff
    • Squash and Merge
  • Visualization
  • Search
    • Basic Search
    • Search Result

Advanced Features

  • Fusion Dataset
  • Storage Config
  • Request Configuration
  • Use Internal Endpoint
  • Profilers
  • Cache

Integrations

  • PaddlePaddle
  • PyTorch
  • TensorFlow

CLI

  • Getting Started with CLI
  • TensorBay Resource Name
  • CLI Commands
  • Shell Completion

Applications

  • Sextant

Reference

  • Glossary
  • Dataset Structure
  • Label Format
    • Common Label Properties
    • Common Subcatalog Properties
    • Classification
    • Box2D
    • Box3D
    • Keypoints2D
    • Polygon
    • MultiPolygon
    • RLE
    • Polyline2D
    • MultiPolyline2D
    • Sentence
    • SemanticMask
    • InstanceMask
    • PanopticMask
  • Exceptions
  • API Reference
    • tensorbay.client
      • tensorbay.client.storage_config
      • tensorbay.client.dataset
      • tensorbay.client.gas
      • tensorbay.client.lazy
      • tensorbay.client.log
      • tensorbay.client.requests
      • tensorbay.client.segment
      • tensorbay.client.status
      • tensorbay.client.struct
      • tensorbay.client.version
      • tensorbay.client.diff
      • tensorbay.client.profile
      • tensorbay.client.statistics
      • tensorbay.client.job
      • tensorbay.client.search
    • tensorbay.dataset
      • tensorbay.dataset.data
      • tensorbay.dataset.dataset
      • tensorbay.dataset.segment
      • tensorbay.dataset.frame
    • tensorbay.geometry
      • tensorbay.geometry.box
      • tensorbay.geometry.keypoint
      • tensorbay.geometry.point_list
      • tensorbay.geometry.polygon
      • tensorbay.geometry.polyline
      • tensorbay.geometry.transform
      • tensorbay.geometry.vector
    • tensorbay.label
      • tensorbay.label.attributes
      • tensorbay.label.basic
      • tensorbay.label.catalog
      • tensorbay.label.label
      • tensorbay.label.label_box
      • tensorbay.label.label_classification
      • tensorbay.label.label_keypoints
      • tensorbay.label.label_mask
      • tensorbay.label.label_polygon
      • tensorbay.label.label_polyline
      • tensorbay.label.label_sentence
      • tensorbay.label.supports
    • tensorbay.sensor
      • tensorbay.sensor.intrinsics
      • tensorbay.sensor.sensor
    • tensorbay.utility
      • tensorbay.utility.attr
      • tensorbay.utility.common
      • tensorbay.utility.deprecated
      • tensorbay.utility.file
      • tensorbay.utility.itertools
      • tensorbay.utility.name
      • tensorbay.utility.repr
      • tensorbay.utility.type
      • tensorbay.utility.user
    • tensorbay.apps
      • tensorbay.apps.sextant
    • tensorbay.exception
    • tensorbay.opendataset
      • tensorbay.opendataset.AADB
      • tensorbay.opendataset.AnimalPose5
      • tensorbay.opendataset.AnimalPose7
      • tensorbay.opendataset.AnimalsWithAttributes2
      • tensorbay.opendataset.BDD100K
      • tensorbay.opendataset.BDD100K_10K
      • tensorbay.opendataset.BDD100K_MOT2020
      • tensorbay.opendataset.BDD100K_MOTS2020
      • tensorbay.opendataset.BSTLD
      • tensorbay.opendataset.BioIDFace
      • tensorbay.opendataset.CACD
      • tensorbay.opendataset.CADC
      • tensorbay.opendataset.CarConnection
      • tensorbay.opendataset.CCPD
      • tensorbay.opendataset.CCPDGreen
      • tensorbay.opendataset.CIHP
      • tensorbay.opendataset.CityscapesGTCoarse
      • tensorbay.opendataset.CityscapesGTFine
      • tensorbay.opendataset.COCO2017
      • tensorbay.opendataset.COVIDChestXRay
      • tensorbay.opendataset.COVID_CT
      • tensorbay.opendataset.CoinImage
      • tensorbay.opendataset.CompCars
      • tensorbay.opendataset.DAVIS2017SemiSupervised
      • tensorbay.opendataset.DAVIS2017Unsupervised
      • tensorbay.opendataset.DeepRoute
      • tensorbay.opendataset.DogsVsCats
      • tensorbay.opendataset.DownsampledImagenet
      • tensorbay.opendataset.Elpv
      • tensorbay.opendataset.FLIC
      • tensorbay.opendataset.FSDD
      • tensorbay.opendataset.Flower17
      • tensorbay.opendataset.Flower102
      • tensorbay.opendataset.HalpeFullBody
      • tensorbay.opendataset.HardHatWorkers
      • tensorbay.opendataset.HeadPoseImage
      • tensorbay.opendataset.HKD
      • tensorbay.opendataset.ImageEmotionAbstract
      • tensorbay.opendataset.ImageEmotionArtphoto
      • tensorbay.opendataset.JHU_CROWD
      • tensorbay.opendataset.KenyanFoodOrNonfood
      • tensorbay.opendataset.KenyanFoodType
      • tensorbay.opendataset.KylbergTexture
      • tensorbay.opendataset.LIP
      • tensorbay.opendataset.LISATrafficLight
      • tensorbay.opendataset.LISATrafficSign
      • tensorbay.opendataset.LeedsSportsPose
      • tensorbay.opendataset.NeolixOD
      • tensorbay.opendataset.Newsgroups20
      • tensorbay.opendataset.NightOwls
      • tensorbay.opendataset.nuImages
      • tensorbay.opendataset.nuScenes
      • tensorbay.opendataset.OxfordIIITPet
      • tensorbay.opendataset.PASCALContext
      • tensorbay.opendataset.RarePlanesReal
      • tensorbay.opendataset.RarePlanesSynthetic
      • tensorbay.opendataset.RP2K
      • tensorbay.opendataset.SCUT_FBP5500
      • tensorbay.opendataset.SegTrack
      • tensorbay.opendataset.SegTrack2
      • tensorbay.opendataset.SVHN
      • tensorbay.opendataset.THCHS30
      • tensorbay.opendataset.THUCNews
      • tensorbay.opendataset.TLR
      • tensorbay.opendataset.UAVDT
      • tensorbay.opendataset.UrbanObjectDetection
      • tensorbay.opendataset.VGGFace2
      • tensorbay.opendataset.VOC2012ActionClassification
      • tensorbay.opendataset.VOC2012Detection
      • tensorbay.opendataset.VOC2012Segmentation
      • tensorbay.opendataset.WIDER_FACE
  v: latest
Versions
latest
stable
v1.24.1
v1.24.0
v1.24.0rc4
v1.24.0rc3
v1.24.0rc2
v1.24.0rc1
v1.20.0
v1.20.0rc1
v1.19.0
v1.19.0rc3
v1.19.0rc2
v1.19.0rc1
v1.18.1
v1.18.0
v1.18.0rc1
v1.17.2
v1.17.1
v1.17.0
v1.17.0rc1
v1.16.1
v1.16.0
v1.16.0rc1
v1.15.0
v1.15.0rc1
v1.14.0
v1.14.0rc1
v1.13.0
v1.13.0rc2
v1.13.0rc1
v1.12.0
v1.12.0rc2
v1.12.0rc1
v1.11.0
v1.11.0rc2
v1.11.0rc1
v1.10.2
v1.10.1
v1.10.1rc1
v1.10.0
v1.10.0rc1
v1.9.0
v1.9.0rc4
v1.9.0rc3
v1.9.0rc2
v1.9.0rc1
v1.8.1
v1.8.0
v1.8.0rc1
v1.7.0
v1.7.0rc1
v1.6.0
v1.6.0rc3
v1.6.0rc2
v1.6.0rc1
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.5.0rc1
v1.4.1
v1.4.0
v1.4.0rc1
v1.3.1
v1.3.0
v1.3.0rc2
v1.3.0rc1
v1.2.2
v1.2.1
v1.2.0
v1.1.2
v1.1.1
v1.1.0
Downloads
pdf
On Read the Docs
Project Home
Builds
Back to top
Edit this page

Basic Search#

TensorBay supports basic search based on different commits.

from tensorbay import GAS

# Please visit `https://gas.graviti.com/tensorbay/developer` to get the AccessKey.
gas = GAS("<YOUR_ACCESSKEY>")
dataset_client = gas.get_dataset("<DATASET_NAME>")

BasicSearchJob#

TensorBay SDK allows create, get or list BasicSearchJob via BasicSearch.

Create#

A BasicSearchJob can be created by create_job()

dataset_client.basic_search.create_job(
    title="search example",
    description="search description",
    conjunction="and",
    unit="file",
    filters=[
        (
            "category",
            "in",
            [
                "human.pedestrian.adult",
                "human.pedestrian.child",
                "human.pedestrian.construction_worker",
            ],
            "BOX3D",
        ),
        ("size", ">", 0),
        ("withLabel", "=", True),
        ("attribute", "in", {"attribute_1": [True, False], "attribute_2": [1, 2]}, "BOX3D"),
    ],
)

Note

conjunction: The logical conjunction between search filters, which includes “and” and “or”.

Note

unit:The unit of basic search. There are two options:
  • “file”: Get the data that meets search filters;

  • “frame”: If at least one data in a frame meets search filters, all data in the frame will be get. This option only works on fusion dataset.

Note

filters: The list of basic search criteria whose format is (key, operator, value, label_type).
  • key: The key of filters, which could be “segment”, “size”, “withLabel”, “frame”, “sensor”, “category”, “attribute” or “keyword”. Here, the meaning of the “keyword” is the remote path of the data, such as “cat_01.jpg”.
  • operator: The operational relationship between the key and value. The supported operators are “like”, “in”, “=”, “>”, “<”, “>=” and “<=”.

  • value: The value of filters.

  • label_type:It only needs to be used if the key is “category” or “attribute”, indicating the label type to which the category or attribute belongs.

There are also some restrictions on operators and values:

key

permitted operator

type of value

“segment”

“in”

list

“size”

“=”, “>”, “<”, “>=”, “<=”

int

“withLabel”

“=”

boolean

“frame”

“like”, “=”

string

“sensor”

“in”

list

“category”

“in”

list

“attribute”

“in”

dict

“keyword”

“like”, “=”

string

Get or List#

The latest BasicSearchJob can be obtained by get_job() or list_jobs().

job = dataset_client.basic_search.get_job("<JOB_ID>")
job = dataset_client.basic_search.list_jobs()[0]

Get Information#

Available BasicSearchJob information includes title, description, job_id, arguments, created_at, started_at, finished_at, status, error_message and result.

job.status
job.result
job.error_message
job.arguments

Note

If the BasicSearchJob is successfully completed, the result will be SearchResult or FusionSearchResult. See more details in Search Result.

Important

Only the latest five search results for one dataset can be used.

Update#

The latest information of a BasicSearchJob can be obtained after update(). Note that if the until_complete is set to True, the BasicSearchJob will be blocked until it is completed.

job.update()
job.update(until_complete=True)

Abort#

BasicSearchJob also supports abort():

job.abort()

Create Dataset#

TensorBay SDK allows to create a dataset based on the search job by create_dataset()

job.create_dataset("<DATASET_NAME>")
Next
Search Result
Previous
Search
Copyright © 2021, Graviti
Made with Sphinx and @pradyunsg's Furo
Contents
  • Basic Search
    • BasicSearchJob
      • Create
      • Get or List
      • Get Information
      • Update
      • Abort
      • Create Dataset