1
1
from labelbox import Client as labelboxClient
2
- from labelpandas import uploader , connector
2
+ import sys
3
+ sys .path .insert (1 , '/Users/luksta/Desktop/Projects/Connectors/labelbox-bigquery' )
4
+ sys .path .insert (1 , '/Users/luksta/Desktop/Projects' )
5
+ sys .path .insert (1 , '/Users/luksta/Desktop/Projects/Connectors/labelbase' )
6
+ sys .path .insert (1 , '/Users/luksta/Desktop/Projects/Connectors/labelpandas' )
7
+ # from labelpandas import uploader, connector
8
+ import uploader , connector
3
9
from labelbase .downloader import *
4
10
from labelbase .uploader import *
5
11
from labelbase .connector import *
12
+ # from downloader import *
13
+ # from uploader import *
14
+ # from connector import *
6
15
import pandas as pd
7
16
8
17
@@ -25,7 +34,7 @@ def __init__(
25
34
self .lb_client = labelboxClient (lb_api_key , endpoint = lb_endpoint , enable_experimental = lb_enable_experimental , app_url = lb_app_url )
26
35
27
36
def export_to_table (
28
- self , project ,
37
+ self , project , lb_api_key ,
29
38
include_metadata :bool = False , include_performance :bool = False , include_agreement :bool = False ,
30
39
verbose :bool = False , mask_method :str = "png" , divider = "///" ):
31
40
""" Creates a Pandas DataFrame given a Labelbox Projet ID
@@ -45,7 +54,7 @@ def export_to_table(
45
54
flattened_labels_dict = export_and_flatten_labels (
46
55
client = self .lb_client , project = project , include_metadata = include_metadata ,
47
56
include_performance = include_performance , include_agreement = include_agreement ,
48
- mask_method = mask_method , verbose = verbose , divider = divider
57
+ mask_method = mask_method , verbose = verbose , divider = divider , lb_api_key = lb_api_key
49
58
)
50
59
# Convert to a Pandas DataFrame
51
60
table = pd .DataFrame .from_dict (flattened_labels_dict )
@@ -229,7 +238,7 @@ def create_data_rows_from_table(
229
238
# Returns:
230
239
# Results from all performed actions in a dictionary - if an expected action has no results, it was not performed
231
240
# """
232
- def upsert_data_rows_from_table (batch_data_rows :bool = False , anootation_method :str = "" ):
241
+ def upsert_data_rows_from_table (self , table : pd . core . frame . DataFrame , dataset_id : str = "" , batch_data_rows :bool = False , annotation_method :str = "" , divider : str = "/// " ):
233
242
""" Performs the following actions if proper information is provided:
234
243
- batches data rows to projects (if batch_data_rows == True) * **
235
244
- uploads annotations as pre-labels or submitted labels * **
0 commit comments