Labelfile

class Labelfile(object)

This namespace represents each lebeling image files in LABELING AI.

init()

__init__(info, user, label_classes)

Parmeters

  • info (str) : Information about the current labeling project corresponding to the object.

  • user (str) : User for creating, modifying, deleting the label project.

  • label_classes (list(Labelclass)) : List of Label classes needed when labeling the current Labelfile object.

Fields

  • id : Project ID.

  • file_name : Name of the file.

  • status : Current status of the file in a project.

  • file_url : Rrl of the file for further connectivity.

  • width : Width of the image file.

  • height : Height of the image file.

  • labelproject : The project that the image belongs to.

  • label_classes : Label classes in the labeling projects.

  • url : Url for making progress in the project, comes from a new Util object.

  • user : User information.

  • user_token : User token information.

repr()

Returns the current object's self.file_name as a printable format.

__repr__()

Return type

  • str

download()

Downloads the current image file to a designated file path.

download(file_path="")

Parmeters

  • file_path (str) : Path for where you want to download, current path set as default.

Return type

  • str

set_done()

Sets the current object's status as done.

set_done(workAssignee=None)

Parmeters

  • workAssignee (str) : Parameter for when you want to set a specific workAssignee's image, None set as default so that if not required, there's no need to enter.

Return type

  • requests(dict)

create_label()

Create a label with a designated class name, color, and other details.

create_label(label, class_name=None, color=None, box=[], polygon=[], structuredData=None)

Parmeters

  • label (Label) : Label object for the label that will be created.

  • class_name (str) : Name of the class for labeling.

  • color (str) : Hex code of the color for labeling.

  • box (list) : List of coordinates for box labeling.

  • polygon (list) : List of coordinates for polygon labeling.

  • structuredData (list) : Whether if it's a structured data.

Return type

  • response(dict)

create_labels()

Create a label from self.create_label() function.

create_labels(labels_raw)

Parmeters

  • labels_raw (dict) : Dict including all the information for the current label, with the keys like labeltype, box, and etc.

Return type

  • response(dict)

delete()

Deletes current Labelfile object.

delete()

Return type

  • None

Last updated