-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add malt0 metric #42
Conversation
3a4704a
to
dbb96db
Compare
There was a problem hiding this 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.
coclico/metrics/metric.py
Outdated
|
||
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
coclico/metrics/metric.py
Outdated
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 |
There was a problem hiding this comment.
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
coclico/metrics/metric.py
Outdated
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 |
There was a problem hiding this comment.
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
test/malt0/test_malt0_relative.py
Outdated
|
||
overall_std = np.sqrt(overall_m2 / overall_count) | ||
|
||
# Generate result with the expected ewuivalent behaviour : concatenate rasters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo equivalent
b822723
to
493cf2e
Compare
890adc6
to
9014e3c
Compare
coclico/malt0/malt0_relative.py
Outdated
|
||
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): |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
f2afa6f
to
ce31e1b
Compare
ce31e1b
to
62bd283
Compare
62bd283
to
25fe429
Compare
ça t'irait comme compromis ? (je voulais garder la trace de pourquoi je garde m2
From: "Guillaume" ***@***.***>
To: "IGNF/coclico" ***@***.***>
Cc: "leavauchier" ***@***.***>, "Author" ***@***.***>
Sent: Thursday, November 30, 2023 3:46:58 PM
Subject: Re: [IGNF/coclico] Add malt0 metric (PR #42)
@gliegard commented on this pull request.
In [ #42 (comment) | coclico/malt0/malt0_relative.py ] :
+ mean_note = bounded_affine_function((0.01, 2), (0.5, 0), mean_diff) # 0 <= mean_note <= 2
+ std_note = bounded_affine_function((0.01, 2), (0.5, 0), std_diff) # 0 <= std_note <= 2
+
+ # divide by 5 because weights are : max_note(1), mean_note(2), std_note(2)
+ note = (max_note + mean_note + std_note) / 5
+
+ return note
+
+ notes = {k: compute_one_note(mean_diff[ii], std_diff[ii], max_diff[ii]) for ii, k in enumerate(classes)}
+
+ return notes
+
+
+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):
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.
—
Reply to this email directly, [ #42 (comment) | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/A4UMMBYBVLE344TSFC4H2OTYHCL6FAVCNFSM6AAAAAA75QFFHKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTONJXGY2DQNRZGQ | unsubscribe ] .
You are receiving this because you authored the thread. Message ID: ***@***.***>
|
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)