Skip to content
Snippets Groups Projects
Commit cfc3262b authored by Léo Calmettes's avatar Léo Calmettes
Browse files

modifié : image_processing/build_dataset.py

	modifié :         main.py
parent a93e5bcc
Branches main
No related tags found
No related merge requests found
...@@ -145,7 +145,7 @@ def create_antibio_dataset(path='../data/label_raw/230804_strain_peptides_antibi ...@@ -145,7 +145,7 @@ def create_antibio_dataset(path='../data/label_raw/230804_strain_peptides_antibi
l = split_before_number(s) l = split_before_number(s)
species = l[0] species = l[0]
nb = l[1] nb = l[1]
return '{}-{}-{}{}.mzML'.format(species,nb,analyse,suffix) return f'{species}-{nb}-{analyse}{suffix}.mzML'
df['path_ana'] = df['sample_name'].map(lambda x: create_fname(x,analyse='ANA')) df['path_ana'] = df['sample_name'].map(lambda x: create_fname(x,analyse='ANA'))
df['path_aer'] = df['sample_name'].map(lambda x: create_fname(x, analyse='AER')) df['path_aer'] = df['sample_name'].map(lambda x: create_fname(x, analyse='AER'))
...@@ -172,8 +172,8 @@ def create_dataset(): ...@@ -172,8 +172,8 @@ def create_dataset():
name = label[label['path_aer'] == path.split("/")[-1]]['sample_name'].values[0] name = label[label['path_aer'] == path.split("/")[-1]]['sample_name'].values[0]
analyse = 'AER' analyse = 'AER'
if species is not None: #save image in species specific dir if species is not None: #save image in species specific dir
directory_path_png = '../data/processed_data/png_image/{}'.format(species) directory_path_png = f'../data/processed_data/png_image/{species}'
directory_path_npy = '../data/processed_data/npy_image/{}'.format(species) directory_path_npy = f'../data/processed_data/npy_image/{species}'
if not os.path.isdir(directory_path_png): if not os.path.isdir(directory_path_png):
os.makedirs(directory_path_png) os.makedirs(directory_path_png)
if not os.path.isdir(directory_path_npy): if not os.path.isdir(directory_path_npy):
......
...@@ -11,6 +11,7 @@ from sklearn.metrics import confusion_matrix ...@@ -11,6 +11,7 @@ from sklearn.metrics import confusion_matrix
import seaborn as sn import seaborn as sn
import pandas as pd import pandas as pd
#test modif git
def train(model, data_train, optimizer, loss_function, epoch): def train(model, data_train, optimizer, loss_function, epoch):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment