Connecting to external data

Overview

If you are storing images in the external data source such as amazon aws or Google Drive, you can connect to these images from AnnoStation.

These images will remain in the external data source and will not be uploaded to AnnoStation.

To connect to the external data source, you need to follow these steps:

  • Prepare a CSV file

  • Import the CSV file to AnnoStation

  • Configure the CORS settings

Prepare CSV file

Include the following fields in your CSV file.

Field

Description

filename

A user generated image name. This string is used as a name of the image in AnnoStation.

imageURL

HTTPS path to the external image URL

Example:

filename,url
42515384_external.jpg,http://127.0.0.1:8080/static/42515384_copy.jpg
73037153_external.jpg,http://127.0.0.1:8080/static/73037153.jpg
73037866_external.jpg,http://127.0.0.1:8080/static/73037866.jpg
10280687_external.jpg,http://127.0.0.1:8080/static/10280687.jpg
m_768_42515384_external.jpg,http://127.0.0.1:8080/static/m_768_42515384.jpg

Import CSV file

To import the CSV file to AnnoStation:

  1. Select New and choose Import file.

  2. Click the Use External Data tab.

  3. Select Choose File and then select the CSV file you prepared.

  4. Click Import.

When the CSV file contains images with the same name as the existing images in AnnoStation, you can either skip such images or overwrite the existing ones.

An icon next to an image indicates if the image is uploaded to AnnoStation or stored in the external data source.

Check the URL of the image file

You can check the URL manually for images that are stored in the external data source, and then change the value if needed.

  1. Go to an image you want to check the URL path, select the ... button on the right and then choose File settings.

  2. This opens the External dataset editing dialog. You can change the file name and URL, and click on Save.

Setup Cross-origin resource sharing (CORS) option

Cross-origin resource sharing (CORS) is a mechanism that allows resources, in this case images, to be requested from AnnoStation which belongs to another domain outside the domain from which the first resource was served such as amazon aws or Google Drive.

In order for AnnoStation to successfully display an image, you need to configure the external data source to allow cross-origin requests.

If cross-origin requests are not allowed, AnnoStation will not be able to display images. In that case, you can force all the images to be rendered from the AnnoStation server. To turn it on:

  1. Go to the Setting page of the Project.

  2. Open Advanced settings, and then select Force all the images render from server to prevent CORS issue.

  3. Click on Update Project.

Last updated

Was this helpful?