You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vision_agent/data/data.py
+17-11Lines changed: 17 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,12 @@ class DataStore:
22
22
r"""A class to store and manage image data along with its generated metadata from an LMM."""
23
23
24
24
def__init__(self, df: pd.DataFrame):
25
-
r"""Initializes the DataStore with a DataFrame containing image paths and image IDs. If the image IDs are not present, they are generated using UUID4. The DataFrame must contain an 'image_paths' column.
25
+
r"""Initializes the DataStore with a DataFrame containing image paths and image
26
+
IDs. If the image IDs are not present, they are generated using UUID4. The
27
+
DataFrame must contain an 'image_paths' column.
26
28
27
29
Args:
28
-
df (pd.DataFrame): The DataFrame containing "image_paths" and "image_id" columns.
30
+
df: The DataFrame containing "image_paths" and "image_id" columns.
r"""Adds a new column to the DataFrame containing the generated metadata from the LMM.
52
+
r"""Adds a new column to the DataFrame containing the generated metadata from
53
+
the LMM.
51
54
52
55
Args:
53
-
name (str): The name of the column to be added.
54
-
prompt (str): The prompt to be used to generate the metadata.
55
-
func (Optional[Callable[[Any], Any]]): A Python function to be applied on the output of `lmm.generate`. Defaults to None.
56
+
name: The name of the column to be added.
57
+
prompt: The prompt to be used to generate the metadata.
58
+
func: A Python function to be applied on the output of `lmm.generate`.
59
+
Defaults to None.
56
60
"""
57
61
ifself.lmmisNone:
58
62
raiseValueError("LMM not set yet")
@@ -67,10 +71,11 @@ def add_column(
67
71
returnself
68
72
69
73
defbuild_index(self, target_col: str) ->Self:
70
-
r"""This will generate embeddings for the `target_col` and build a searchable index over them, so next time you run search it will search over this index.
74
+
r"""This will generate embeddings for the `target_col` and build a searchable
75
+
index over them, so next time you run search it will search over this index.
71
76
72
77
Args:
73
-
target_col (str): The column name containing the data to be indexed."""
78
+
target_col: The column name containing the data to be indexed."""
0 commit comments