Quickstart

Request a demo to gain access to the Coactive platform, once you’ve been granted access you can follow this minimal example to get started.

All the code should run as is.

1. Install coactive

Download our latest sdk and install it in your local python environment

$pip install coactive

2. Authenticate

Next, load the authentication credentials necessary for calling the Coactive APIs. Note that these variables are environment specific and will be provided by Coactive. As a Coactive admin go to the credentials page.

Python
1from coactive.client import Coactive
2
3client = Coactive(
4 client_id="YOUR_CLIENT_ID",
5 client_secret="YOUR_CLIENT_SECRET",
6)

3. Initialize a dataset on Coactive

To get started, create a dataset and add an initial set of data to your dataset. If you want to add your own data you may have to provide Coactive access to your visual data, more details can be found here. You can also add video paths or add a CSV or s3/GCS bucket to the dataset. See the add assets endpoint for all options.

Python
1from coactive import AddImageRequest, AddVideoRequest
2
3dataset = client.dataset.create(
4 name="MyFirstDataset",
5 description="A dataset containing some nice photos",
6)
7
8client.dataset.add_assets(
9 dataset_id=dataset.dataset_id,
10 data_path="s3://coactive-public/datasets/quickstart/",
11)

Once Coactive has access to your data, it will convert your unstructured visual data to semantically meaningful representations. This enables fast access to all your visual data and the core functionalities of Coactive, such as intelligent search, dynamic tags and real-time analytics. Depending on the volume of data, ingesting might take a while. Once the datasets status is Ready you can start using the powers of Coactive.

Python
1dataset = client.dataset.get(
2 dataset_id=dataset.dataset_id,
3)
4print(f"Dataset is in status: {dataset.status}")

Once the dataset is ready we can immediately start searching through our data.

Python
1search_results = client.search.search_dataset(
2 dataset_id="string",
3 query="dogs or cats",
4 offset=0,
5 limit=10
6)

You can also add your own custom defined concepts to power your search. See our Intelligent search tutorial (Coming Soon)

5. Further reading