Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
VLucet committed Jan 12, 2024
1 parent 033845f commit 07fee0a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mdtools/labelstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def post_process_annotations(ls_json, data_str="data/local-files/?d="):
pd.json_normalize(bb["result"], sep = "_", max_level=1)
.assign(source_file = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[1:]))
# .assign(source_file_with_dep = "/".join(ann["data"]["image"]
# .replace(data_str, "").strip("/").split('/')[0:]))
.assign(source_file_with_dep = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[0:]))
.rename(columns={'from_name': 'variable'})
)
bb["label_temp"] = (
Expand Down Expand Up @@ -129,8 +129,8 @@ def post_process_annotations(ls_json, data_str="data/local-files/?d="):
pd.json_normalize(bb["prediction"]["result"], sep = "_", max_level=1)
.assign(source_file = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[1:]))
# .assign(source_file_with_dep = "/".join(ann["data"]["image"]
# .replace(data_str, "").strip("/").split('/')[0:]))
.assign(source_file_with_dep = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[0:]))
.rename(columns={'from_name': 'variable'})
)

Expand All @@ -153,8 +153,8 @@ def post_process_annotations(ls_json, data_str="data/local-files/?d="):
pd.json_normalize(bb, sep = "_", max_level=1)
.assign(source_file = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[1:]))
# .assign(source_file_with_dep = "/".join(ann["data"]["image"]
# .replace(data_str, "").strip("/").split('/')[0:]))
.assign(source_file_with_dep = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[0:]))
.rename(columns={'from_name': 'variable'})
)[['id', 'source_file']]

Expand All @@ -172,8 +172,8 @@ def post_process_annotations(ls_json, data_str="data/local-files/?d="):
pd.json_normalize(bb, sep = "_", max_level=1)
.assign(source_file = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[1:]))
# .assign(source_file_with_dep = "/".join(ann["data"]["image"]
# .replace(data_str, "").strip("/").split('/')[0:]))
.assign(source_file_with_dep = "/".join(ann["data"]["image"]
.replace(data_str, "").strip("/").split('/')[0:]))
.rename(columns={'from_name': 'variable'})
)[['id', 'source_file']]

Expand Down Expand Up @@ -223,8 +223,8 @@ def get_name(df):
# ls = json.loads(data)

print(df.head())

source_file_ex = df["source_file"].iloc[0]
column_name = "source_file"
source_file_ex = df.at[df[column_name].first_valid_index(), column_name]
print(source_file_ex)
proj = source_file_ex.split("/")[0]
print(proj)
Expand Down

0 comments on commit 07fee0a

Please sign in to comment.