Skip to content


class Labelfile(object)

This namespace represents each lebeling image files in LABELING AI.


__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: url 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


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

  • Return type:
    • str


Downloads the current image file to a designated file path

  • Parmeters:
    • file_path (str): path for where you want to download, current path set as default
  • Return type:
    • str


Sets the current object's status as "done"

  • 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)r


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 a label from self.create_label() function

  • 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

  • Return type:
    • None