Image Management
  • 14 Sep 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Image Management

  • Dark
    Light
  • PDF

 

This article is deprecated.

Article Summary

Note:
The LandingLens CLI has been deprecated. We recommend using the Python SDK instead. Additionally, the CLI is only supported in the Classic Flow version of LandingLens.

This section explains how to use the  LandingLens CLI to manage your dataset. You will be able to:

  • Upload new images with label, split, and metadata information.
  • Set metadata for existing images.

SDK Usage

from landinglens import LandingLens

# Instantiate the llens client - Optionally can provide API Key and Secret
llens = LandingLens()

llens.metadata.upload(media_id=[123, 124], timestamp=12345)
# project_id: 1190
# metadata:   {"timestamp": "12345"}
# media_ids:  [123, 124]

llens.media.ls()
# (lists all media with metadata from a project)
# { medias: [{'id': 4358352, 'mediaType': 'image', 'srcType': 'user', 'srcName': 'Michal', 'properties': {'width': 258, 'height': 176}, 'name': 'n01443537_501.JPEG', 'uploadTime': '2020-09-15T22:29:01.338Z', 'metadata': {'source': 'prod'}, 'media_status': 'raw'}, ...],
# num_requested: 1000,
# count: 300,
# offset: 0,
# limit: 1000 }

# paginate explicitly
llens.media.ls(offset=0, limit=100)

# this one will fetch all
llens.media.ls(no_pagination=True)

# any metadata can be used to filter the media (server side filtering)
llens.media.ls(no_pagination=True, source="prod")

# only single media upload and without metadata
llens.media.upload("~/Documents/image.jpg")

# folder upload, will upload all the media in the folder recursively
llens.media.upload("~/Documents/image_folder")

LandingLens CLI Usage

llens metadata upload --media_id=123,124 --timestamp=12345

# project_id: 1190
# metadata:   {"timestamp": "12345"}
# media_ids:  [123, 124]

llens media ls
# (lists media with metadata from a project)
# { medias: [{'id': 4358352, 'mediaType': 'image', 'srcType': 'user', 'srcName': 'Michal', 'properties': {'width': 258, 'height': 176}, 'name': 'n01443537_501.JPEG', 'uploadTime': '2020-09-15T22:29:01.338Z', 'metadata': {'source': 'prod'}, 'media_status': 'raw'}, ...],
# num_requested: 1000,
# count: 300,
# offset: 0,
# limit: 1000 }

# paginate explicitly
llens media ls --offset 0 --limit 100

# this one will fetch all
llens media ls --no-pagination

# any metadata can be used to filter the media (server side filtering)
llens media ls --no-pagination --source prod

# only single media upload and without metadata
llens media upload ~/Documents/image.jpg

# folder upload, will upload all the media in the folder recursively
llens media upload ~/Documents/image_folder

Was this article helpful?

What's Next