Skip to content
Snippets Groups Projects
Commit c5f83ddf authored by Stephane Chavin's avatar Stephane Chavin
Browse files

Correction yaml

parent c541e7df
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ import matplotlib.patches as patches
from matplotlib.patches import Rectangle
from PIL import Image
from mycolorpy import colorlist as mcp
import yaml
today = date.today()
......@@ -63,6 +64,9 @@ for i in range (len(list_espece)):
new_col = pd.DataFrame([[esp,i]],columns = ['espece','ind'])
data = pd.concat([data,new_col])
liste_espece = data.espece
liste_espece.to_csv(str(direction+'liste_especes.csv'),index = False)
print('\n',data)
color = mcp.gen_color(cmap = "Wistia", n= len(list_espece))
......
......@@ -108,8 +108,12 @@ for i,row in tqdm(train.iterrows(), total=train.shape[0]):
shutil.copy2(str(path+row.file+'.txt'),str(direction+'labels/train/'+row.file+'.txt'))
shutil.copy2(str(path+'../images/all/'+row.file+'.jpg'),str(direction+'images/train/'+row.file+'.jpg'))
liste_espece = pd.read_csv(str(path+'../liste_especes.csv'))
with open(str(direction+'custom_data.yaml'),'w') as f:
f.write('train : '+direction+'images/train\n')
f.write('test : '+direction+'images/val\n')
f.write('nc : ' + str(len(tab))+'\n')
f.write('names : ' + str(tab.index.tolist()))
#f.write('nc : ' + str(len(tab))+'\n')
f.write('nc : ' + str(len(liste_espece))+'\n')
f.write('names : '+ str(liste_espece.espece.tolist()))
#f.write('names : ' + str(tab.index.tolist()))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment