Skip to content

Commit

Permalink
Running the tutorial
Browse files Browse the repository at this point in the history
Adding a tutorial with some explanation.
The files generated when runing the tutorial are also added.
Update Tutorial.md
Update README.md
Update Tutorial

-Fixing support for single image simulations of the  MAS
-Fixed a typo in the directoy spelling of the output path
Typo

Fixing the paths to include the session number
Update Tutorial.md

-Fixing typo
-Include info about Single_Image_Simulation_v11.py
  • Loading branch information
Jacopin Eliott committed May 20, 2021
1 parent adc8912 commit b5304b7
Show file tree
Hide file tree
Showing 62 changed files with 227,466 additions and 48 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Auto detect text files and perform LF normalization
* text=auto
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
Binary file added BSAS/__pycache__/bsas.cpython-37.pyc
Binary file not shown.
Binary file added BSAS/__pycache__/bsas_functions.cpython-37.pyc
Binary file not shown.
8 changes: 1 addition & 7 deletions Crops_Rows_Angle_Detection/CRAD.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ def __init__(self,
_path_output_histogram
):
"""
_path_original_img leads to the original picture of the field
_path_txt leads to a text files which contains the coordinates of all centroids
obtained through bsas implementation or dbscan
_display_all_steps should be set to True if the user wants to see the results of the successive steps of the process
(images with the detected lines are displayed)
TO DO
"""

self.img_id = img_id
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/CropFields_Sample/Example_grapevine.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/FourierAnalysis_v3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/Logos/LOGO_TerresInnovia.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/Logos/ekinocs-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/Logos/logoAPT.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Documentation/Images/MAS_Hierarchy_Structure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Fourier/FrequencyAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,6 @@ def All_Fourier_Analysis(_path_input_output,

if (__name__ == "__main__"):

All_Fourier_Analysis(_path_input_output="C:/Users/eliot/Documents/Scolarité/AgroParisTech/3A/Stage_Tournesols/Code/Ouput_General",
All_Fourier_Analysis(_path_input_output="../Tutorial/Output_General/Set1",
_session_number=1,
_bin_div_X=2, _bin_div_Y=4)
4 changes: 2 additions & 2 deletions MAS/Multi_Images_Simulation_v12bis.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def All_Simulations(_path_input_rgb_img, _path_PreTreatment_and_FA,

if (__name__=="__main__"):

All_Simulations(_path_input_rgb_img="C:/Users/eliot/Documents/Scolarité/AgroParisTech/3A/Stage_Tournesols/Code/Datasets/Test",
_path_PreTreatment_and_FA="C:/Users/eliot/Documents/Scolarité/AgroParisTech/3A/Stage_Tournesols/Code/Ouput_General",
All_Simulations(_path_input_rgb_img="../Tutorial/Data/Non-Labelled/Set1",
_path_PreTreatment_and_FA="../Tutorial/Output_General/Set1",
_session_number=1,
_RAs_group_size=20, _RAs_group_steps=2, _Simulation_steps=50,
_RALs_fuse_factor=0.5, _RALs_fill_factor=1.5)
47 changes: 19 additions & 28 deletions MAS/Single_Image_Simulation_v11.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,19 @@ def get_file_lines(path_csv_file):
# =============================================================================
#path of the images
### TO BE CHANGED AS PER USER NEED
session_number = 3
unity_date = "2020_7_30_15_10_36"
session_number = 1

path_input_root = "C:/Users/eliot/Documents/Scolarité/AgroParisTech/3A/Stage_Tournesols"
# =============================================================================
# path_input_raw = path_input_root+"/Unity/Screenshots/"+unity_date+"/virtual_reality"
# path_input_adjusted_position_files = path_input_root+"/Travaux_Fil_Rouge/code_tournesol_4/Output_FT/Session_{0}/Adjusted_Position_Files".format(session_number)
# path_input_OTSU = path_input_root+"/Travaux_Fil_Rouge/code_tournesol_4/Output/Session_{0}/Otsu_R".format(session_number)
# path_input_PLANT_FT_PRED = path_input_root+"/Travaux_Fil_Rouge/code_tournesol_4/Output_FT/Session_{0}/Plant_FT_Predictions".format(session_number)
# =============================================================================
path_input_root = "../Tutorial"

path_input_raw = path_input_root+"/Unity/Screenshots/MetaCapture_Session_{0}".format(session_number)+\
"/"+unity_date+"/virtual_reality"
path_input_adjusted_position_files = path_input_root+"/Travaux_Fil_Rouge/code_tournesol_4/Output_FT/MetaCapture_Session_{0}".format(session_number)+\
"/"+unity_date+\
"/Adjusted_Position_Files"
path_input_OTSU = path_input_root+"/Travaux_Fil_Rouge/code_tournesol_4/Output/MetaCapture_Session_{0}".format(session_number)+\
"/"+unity_date+"/Otsu_R"
path_input_PLANT_FT_PRED = path_input_root+"/Travaux_Fil_Rouge/code_tournesol_4/Output_FT/MetaCapture_Session_{0}".format(session_number)+\
"/"+unity_date + \
"/Plant_FT_Predictions"
path_input_raw = path_input_root+"/Data/Non-Labelled/Set1"
#path_input_adjusted_position_files = ""
path_input_OTSU = path_input_root+"/Output_General/Set1/Output/Session_"+\
str(session_number)+"/Otsu_R"
path_input_PLANT_FT_PRED = path_input_root+"/Output_General/Set1/Output_FA/Session_"+\
str(session_number)+"/Plant_FT_Predictions"

names_input_raw = os.listdir(path_input_raw)
names_input_adjusted_position_files = os.listdir(path_input_adjusted_position_files)
#names_input_adjusted_position_files = os.listdir(path_input_adjusted_position_files)
names_input_OTSU = os.listdir(path_input_OTSU)
names_input_PLANT_FT_PRED = os.listdir(path_input_PLANT_FT_PRED)

Expand All @@ -78,9 +67,11 @@ def get_file_lines(path_csv_file):
data_input_raw = import_data(path_input_raw,
names_input_raw[:subset_size],
get_img_array)
data_adjusted_position_files = import_data(path_input_adjusted_position_files,
names_input_adjusted_position_files[:subset_size],
get_file_lines)
# =============================================================================
# data_adjusted_position_files = import_data(path_input_adjusted_position_files,
# names_input_adjusted_position_files[:subset_size],
# get_file_lines)
# =============================================================================
data_input_OTSU = import_data(path_input_OTSU,
names_input_OTSU[:subset_size],
get_img_array)
Expand All @@ -103,7 +94,7 @@ def get_file_lines(path_csv_file):
_image_index = 0

print(names_input_OTSU[_image_index])
print(names_input_adjusted_position_files[_image_index])
#print(names_input_adjusted_position_files[_image_index])
print(names_input_PLANT_FT_PRED[_image_index])

# =============================================================================
Expand All @@ -116,7 +107,7 @@ def get_file_lines(path_csv_file):
RAs_group_size, RAs_group_steps,
RALs_fuse_factor, RALs_fill_factor,
[0,0],
data_adjusted_position_files[_image_index])
None)#data_adjusted_position_files[_image_index])
MAS_Simulation.Initialize_AD()
MAS_Simulation.Perform_Simulation_newEndCrit(Simulation_steps,
_coerced_X=True,
Expand Down Expand Up @@ -147,6 +138,6 @@ def get_file_lines(path_csv_file):
# print("FP =", MAS_Simulation.FP)
# =============================================================================

MAS_Simulation.Show_Adjusted_And_RALs_positions()
MAS_Simulation.Show_nb_RALs()
MAS_Simulation.Show_RALs_Deicision_Scores()
MAS_Simulation.Show_RALs_Position(_recorded_position_indeces=[-1], _colors=['g'])
#MAS_Simulation.Show_nb_RALs()
#MAS_Simulation.Show_RALs_Deicision_Scores()
Binary file added MAS/__pycache__/MAS_v16.cpython-37.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions Pre_Treatments/Process_image_for_FT.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ def All_Pre_Treatment(_path_input_rgb_img, _path_output_root,

if (__name__=="__main__"):

All_Pre_Treatment(_path_input_rgb_img="C:/Users/eliot/Documents/Scolarité/AgroParisTech/3A/Stage_Tournesols/Code/Datasets/Test",
_path_output_root="C:/Users/eliot/Documents/Scolarité/AgroParisTech/3A/Stage_Tournesols/Code/Ouput_General",
All_Pre_Treatment(_path_input_rgb_img="../Tutorial/Data/Non-Labelled/Set1",
_path_output_root="../Tutorial/Output_General/Set1",
_make_unique_folder_per_session=True, _session=1,
_do_Otsu=True, _do_AD=True,
_save_AD_score_images=False, _save_BSAS_images=False,
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ the procedure will consist in [Pre-Processing](https://github.com/LittleCoinCoin
Plants](https://github.com/LittleCoinCoin/Plant_Counting/blob/Pre-Release/Documentation/MAS/Multi_Images_Simulation_v12bis.md) (with the MAS). It is possible to Rune all three steps in one go with the script named *WholeProcess.py*; or
all three steps separately with the scripts *Process_image_for_FT.py*, *FrequencyAnalysis.py* and *Multi_Images_Simulation_v12bis.py*.
Further details about each scripts are available in the Documentation.
A little [tutorial](https://github.com/LittleCoinCoin/Plant_Counting/blob/Pre-Release/Tutorial/Tutorial.md) is available

# References
* The paper presenting the method:
Expand Down
Binary file added Segmentation_Otsu/__pycache__/data.cpython-37.pyc
Binary file not shown.
Binary file added Segmentation_Otsu/__pycache__/otsu.cpython-37.pyc
Binary file not shown.
6 changes: 5 additions & 1 deletion Segmentation_Otsu/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"""
Created on Wed Jan 29 13:36:47 2020
@author: Le groupe tournesol
@author:
Naomie Berda
Léa Courteille
Grison William
Lucas Mathieu
"""

import os
Expand Down
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set1/rgb_83.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set1/rgb_85.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set1/rgb_87.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set1/rgb_89.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set2/rgb_91.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set2/rgb_93.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set2/rgb_95.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Tutorial/Data/Non-Labelled/Set2/rgb_97.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit b5304b7

Please sign in to comment.