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

rework metrics #125

Merged
merged 77 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
ef212c6
start metrics template
ismael-mendoza Apr 7, 2021
9129b70
Reorganized metrics
Apr 13, 2021
9e1f1f2
typo
ismael-mendoza Apr 13, 2021
74bfe8d
update docstring
ismael-mendoza Apr 13, 2021
11d044d
docstring module
ismael-mendoza Apr 13, 2021
6c0e191
shouldbe py37
ismael-mendoza Apr 13, 2021
121b70b
Modified matches
Apr 14, 2021
79508a6
Merge branch 'rework-metrics' of github.com:LSSTDESC/BlendingToolKit …
Apr 14, 2021
41fe669
Added new metrics and adjusted matches (still WIP)
Apr 14, 2021
c977786
Fixed matches and added F1 score
Apr 14, 2021
f09c037
Small fixes and added IoU for segmentation
Apr 14, 2021
4305dea
Added generator instead of wrap
Apr 15, 2021
ad4f3b4
new way of doing detections
ismael-mendoza Apr 15, 2021
197d40d
fix docstring
ismael-mendoza Apr 15, 2021
68f740c
more explicit
ismael-mendoza Apr 15, 2021
19fa6aa
Fixed issues, added statistics per galaxy and basic plotting function
Apr 15, 2021
8e7f275
Merge branch 'rework-metrics' of github.com:LSSTDESC/BlendingToolKit …
Apr 15, 2021
2e46e97
Removed the old matching function
Apr 15, 2021
15ad82d
Added detected boolean column and distance, and new function for plot…
Apr 15, 2021
52d54d5
start metrics template
ismael-mendoza Apr 7, 2021
d88af72
Reorganized metrics
Apr 13, 2021
34fded1
Modified matches
Apr 14, 2021
ea6b1ad
typo
ismael-mendoza Apr 13, 2021
3a3f24d
update docstring
ismael-mendoza Apr 13, 2021
57db289
docstring module
ismael-mendoza Apr 13, 2021
06e2650
Added new metrics and adjusted matches (still WIP)
Apr 14, 2021
a09c758
Fixed matches and added F1 score
Apr 14, 2021
8e9002e
Small fixes and added IoU for segmentation
Apr 14, 2021
ec551fe
Added generator instead of wrap
Apr 15, 2021
72817c3
Fixed issues, added statistics per galaxy and basic plotting function
Apr 15, 2021
4f9aef5
new way of doing detections
ismael-mendoza Apr 15, 2021
14afd16
fix docstring
ismael-mendoza Apr 15, 2021
555f7bf
more explicit
ismael-mendoza Apr 15, 2021
626de51
Removed the old matching function
Apr 15, 2021
036cd5d
Added detected boolean column and distance, and new function for plot…
Apr 15, 2021
459940d
Added new plot features and distance to closest galaxy column
Apr 16, 2021
f15f1fc
added some docstrings
ismael-mendoza Apr 16, 2021
603004a
no need to name j variable if unused
ismael-mendoza Apr 16, 2021
1934ecd
Handling case with single measure_function
Apr 16, 2021
340515d
Merge branch 'rework-metrics' of github.com:LSSTDESC/BlendingToolKit …
Apr 16, 2021
a060b95
Tentative structure for measuring ellipticities and the like
Apr 19, 2021
b33dfd4
Added blendedness
Apr 19, 2021
aa86b63
Added target measurement metric
Apr 20, 2021
ef87c3e
refactoring and readability
ismael-mendoza Apr 20, 2021
5d1a3ee
improve docstring
ismael-mendoza Apr 20, 2021
c4df1d0
added more docstrings and remove unused arguments
ismael-mendoza Apr 20, 2021
8486b1c
added more docstrings, starting new function
ismael-mendoza Apr 20, 2021
02b2f52
add blend_counter to keep track of blends between batches; first draf…
ismael-mendoza Apr 20, 2021
d202dec
Merge branch 'rework-metrics' of github.com:LSSTDESC/BlendingToolKit …
Apr 20, 2021
f94045f
Made the detection metrics global instead of per blend
Apr 21, 2021
06a78fc
Cleaned the target_meas a bit
Apr 21, 2021
49a372b
Fixed dim_order everywhere
Apr 21, 2021
fc1ab80
Cleaned target_meas some more and fixed blendedness
Apr 21, 2021
99b0c2d
Added docstring for comput_metrics
Apr 21, 2021
2f7ad19
docstring additions
ismael-mendoza Apr 21, 2021
c0894d6
periods
ismael-mendoza Apr 21, 2021
9fdf803
change N->M
ismael-mendoza Apr 22, 2021
f304603
Update btk/plot_utils.py
ismael-mendoza Apr 22, 2021
b4f5c94
Updated tutorial (WIP), and made a few corrections
Apr 22, 2021
804e1d0
Merge branch 'rework-metrics' of github.com:LSSTDESC/BlendingToolKit …
Apr 22, 2021
e6d4a2d
Modified plot functions to take an ax as argument
Apr 22, 2021
aae9c5d
Separated functions
thuiop Apr 23, 2021
0a26ddc
Added docstrings
thuiop Apr 23, 2021
8cb63d7
Added more docstrings and removed unnecessary arguments
thuiop Apr 23, 2021
06749bc
Updated tests and added back efficiency matrix
thuiop Apr 26, 2021
3ef608f
Added execution test for metrics generator
thuiop Apr 26, 2021
4baa52d
Added plots to the metrics tests
thuiop Apr 26, 2021
353fffd
Merge branch 'main' into rework-metrics
thuiop Apr 27, 2021
89eb357
Convert to channels_last after rebase
thuiop Apr 27, 2021
7f4f1ee
Improved doc
thuiop Apr 27, 2021
c1338cf
Added documentation on all the metrics
thuiop Apr 27, 2021
105fa74
Added plot_utils to doc and updated flowchart
thuiop Apr 27, 2021
0553b99
Updated tutorial and added check for columns
thuiop Apr 28, 2021
44391da
Corrected IoU threshold
thuiop Apr 28, 2021
c40d03c
Changed default value for ellipticity and added metrics to precommit …
thuiop Apr 28, 2021
08a3b28
avoid special cases in returning measure_results and metrics_results
ismael-mendoza Apr 28, 2021
3608fec
avoid long multi-line commands
ismael-mendoza Apr 28, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions btk/measure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
`(n_objects, stamp_size, stamp_size, n_bands)` depending on
convention. The order of this array should correspond to the
order in the returned `catalog`. Where `n_objects` is the
number of detected objects
number of detected objects by the algorithm.
- segmentation (np.ndarray): Array of booleans with shape `(n_objects,stamp_size,stamp_size)`
The pixels set to True in the i-th channel correspond to the i-th
object. The order should correspond to the order in the returned
Expand Down Expand Up @@ -218,18 +218,27 @@ def __next__(self):

Returns:
draw_blend_generator output from `__next__` method.
measurement output: List of length `batch_size`, where each element is a list of
measurement_results: List of length `batch_size`, where each element is a list of
`len(measure_functions)` corresponding to the measurements made by
each function on each element of the batch.
"""
blend_output = next(self.draw_blend_generator)
input_args = ((blend_output, i) for i in range(self.batch_size))
measure_results = multiprocess(
measure_output = multiprocess(
self.run_batch,
input_args,
self.cpus,
self.verbose,
)
if self.verbose:
print("Measurement performed on batch")
measure_results = {}
for i, f in enumerate(self.measure_functions):
measure_dic = {}
for key in ["catalog", "deblended_images", "segmentation"]:
if key in measure_output[0][i] and measure_output[0][i][key] is not None:
thuiop marked this conversation as resolved.
Show resolved Hide resolved
measure_dic[key] = [
measure_output[j][i][key] for j in range(len(measure_output))
]
measure_results[f.__name__] = measure_dic
return blend_output, measure_results
Loading