Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 71a65a7

Browse files
Luke MoehlenbrockLuke Moehlenbrock
authored andcommitted
Update client.export_to_table for exports v2
1 parent df34ce1 commit 71a65a7

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

labelpandas/client.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
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
39
from labelbase.downloader import *
410
from labelbase.uploader import *
511
from labelbase.connector import *
12+
# from downloader import *
13+
# from uploader import *
14+
# from connector import *
615
import pandas as pd
716

817

@@ -25,7 +34,7 @@ def __init__(
2534
self.lb_client = labelboxClient(lb_api_key, endpoint=lb_endpoint, enable_experimental=lb_enable_experimental, app_url=lb_app_url)
2635

2736
def export_to_table(
28-
self, project,
37+
self, project, lb_api_key,
2938
include_metadata:bool=False, include_performance:bool=False, include_agreement:bool=False,
3039
verbose:bool=False, mask_method:str="png", divider="///"):
3140
""" Creates a Pandas DataFrame given a Labelbox Projet ID
@@ -45,7 +54,7 @@ def export_to_table(
4554
flattened_labels_dict = export_and_flatten_labels(
4655
client=self.lb_client, project=project, include_metadata=include_metadata,
4756
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
4958
)
5059
# Convert to a Pandas DataFrame
5160
table = pd.DataFrame.from_dict(flattened_labels_dict)
@@ -229,7 +238,7 @@ def create_data_rows_from_table(
229238
# Returns:
230239
# Results from all performed actions in a dictionary - if an expected action has no results, it was not performed
231240
# """
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="///"):
233242
""" Performs the following actions if proper information is provided:
234243
- batches data rows to projects (if batch_data_rows == True) * **
235244
- uploads annotations as pre-labels or submitted labels * **

0 commit comments

Comments
 (0)