Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add malt0 metric #42

Merged
merged 11 commits into from
Nov 30, 2023
Merged

Add malt0 metric #42

merged 11 commits into from
Nov 30, 2023

Conversation

leavauchier
Copy link
Member

Ajout de la métrique MALT0 (métrique altimétrique 0) qui compare les hauteurs à partir de MNx (modèle numériques pour chaque classe)

Copy link
Collaborator

@gliegard gliegard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super boulot, bravo !!
j'ai fait quelque remarques, pour ajouter des commentaires, typos, et autres suggestions de reformulations de commentaires.

README.md Outdated Show resolved Hide resolved
coclico/malt0/malt0_intrinsic.py Outdated Show resolved Hide resolved
coclico/malt0/malt0_intrinsic.py Outdated Show resolved Hide resolved
coclico/malt0/malt0_relative.py Outdated Show resolved Hide resolved
coclico/malt0/malt0_relative.py Outdated Show resolved Hide resolved

def create_metric_intrinsic_one_job(self, name: str, input: Path, output: Path, is_ref: bool) -> Job:
"""Create a job for a single input classification result file (one tile).
ie. job to create of one element of the `tiles_names` list in create_metric_intrinsic_jobs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai un pb avec classification result dans le sens où c'est le resultat d'un process hors de ce projet. Je pense que c'est le fait d'avoir en même temps input et result qui est confusant. Et la seconde partie , ie... , je trouve ça compliqué à comprendre, et ça apporte pas grand chose au développeur d'une nouvelle métrique. Suggestion plus simple :
Create a job, to compute intrinsect metric, for a single pointcloud file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep c'est pas très clair, je vais changer

raise NotImplementedError

def create_metric_relative_to_ref_jobs(
self, name: str, out_c1: Path, out_ref: Path, output: Path, c1_jobs: List[Job], ref_jobs: List[Job]
) -> List[Job]:
"""Create jobs to generate a metric that compares the classification results from a c1 folder and th ref folder
based on the results of the results of the jobs created by create_metric_intrinsic_jobs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pareil, j'aime pas trop result pour parler de l'entrée. Typo: and th ref. Et sur la seconde phrase y'a écrit "the result of the result". Perso j'aurai fait deux phrases, suggestion:
Create jobs to compute a metric that compares a classification folder (ex: c1) to the reference folder. It uses intermediary results produced by jobs created by create_metric_intrinsec_jobs

output (Path): path to the results of the relative metric
c1_jobs (List[Job]): Jobs created in create_metric_intrinsic_jobs for c1 (on which the jobs created in this
method will depend)
ref_jobs (List[Job]): Jobs created in create_metric_intrinsic_jobs for ref (on which the jobs created in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ce qui est entre parenthese est en fait très important : le développeur qui ajoute une métrique ne doit pas oublier de le faire. J'aurai bien écrit quelque chose de plus alertant, genre une seconde ligne, comme ceci :

Note: Each new jobs must depends on these ref jobs, to ensure it will be computed after.

Ce commentaire s'applique aussi au param c1_jobs


overall_std = np.sqrt(overall_m2 / overall_count)

# Generate result with the expected ewuivalent behaviour : concatenate rasters
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo equivalent

coclico/malt0/malt0.py Show resolved Hide resolved
@leavauchier leavauchier force-pushed the feat-malt0 branch 2 times, most recently from 890adc6 to 9014e3c Compare November 30, 2023 09:20

def compute_stats_single_raster(raster: np.array, occupancy_raster: np.array):
"""Compute stats for a single raster, masked by an occupancy raster.
Returns np.arrays with one value of each stat for each layer (first dimension of the raster):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je comprend pas la fin "for each layer (first dimension of the raster)"

  • for each layer: c'est pour préciser qu'il y a une couche par classe ?
  • first dimension of the raster: ça veut dire quoi ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ton raster c'est un numpy.array, et du coup les layers du raster sont représentés par la première dimension de cet array

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est-ce que si je mets : for each layer of the raster (which corresponds to the first dimension of the numpy array) c'est plus clair ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en gros c'est pour préciser qu'en sortie j'ai pas une seule valeur de moyenne, mais une par couche du raster (avec une couche du raster qui correspond au mnx pour une classe)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, du coup à la fin, pour chaque stats, tu as plusieurs valeurs , une par couche du layer (les couche du layer representant des classes) , c'est ça ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, à la fin pour chaque stat j'ai une valeur par couche (=layer) de mon raster

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, je te suggere 2 phrases comme ceci :

Returns a np.arrays for each stats (max value, pixel count, mean, standard deviation and m2)
Each array contains many values: a value for each layer of the raster.

@leavauchier
Copy link
Member Author

leavauchier commented Nov 30, 2023 via email

@leavauchier leavauchier merged commit 951f2f2 into main Nov 30, 2023
1 check passed
@leavauchier leavauchier deleted the feat-malt0 branch November 30, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants