Skip to content

MICCAI surgtoolloc preprocess_detect_scene_and_split_fold missing train.csv? #1439

Answered by yiheng-wang-nv
lukigg asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lukigg , sorry for misleading.
The train.csv is actually produced in: Load data section, from:

df = pd.read_csv('/raid/surg/_release/training_data/labels.csv')[['clip_name', 'tools_present']]
img_dir = '/raid/surg/image640_blur/'
cpu_ct = 32


def split_label(s):
    return [x.strip(' ') for x in s[1:-1].split(',')]


label_lst = df.tools_present.apply(split_label).values.tolist()
label_lst = [x for xs in label_lst for x in xs]

labels = pd.Series(label_lst).value_counts().index.values[1:]
for lb in labels:
    df[lb] = df.tools_present.str.count(lb)

labels = df.columns.values[2:]
df.shape

but the save to csv line is not existing.

I will submit a PR to fix this issue. Thanks for pos…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@lukigg
Comment options

Comment options

You must be logged in to vote
2 replies
@yiheng-wang-nv
Comment options

@lukigg
Comment options

Answer selected by KumoLiu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants