anomalib icon indicating copy to clipboard operation
anomalib copied to clipboard

Where can I save the segmentation results separately

Open wangk98 opened this issue 3 years ago • 7 comments

sorry to bother you ! Where can I save the segmentation results separately?Because I want to get the specific coordinates of the defect. And I can't find the presion and recall, I also want to output them.

wangk98 avatar May 05 '22 03:05 wangk98

@wangk98, PR #298 would potentially addresses your issue. Once merged, we could add some documentation

samet-akcay avatar May 16 '22 18:05 samet-akcay

Regarding setting different metrics, you could modify the configuration as follows: image

samet-akcay avatar Jul 11 '22 17:07 samet-akcay

@wangk98, regarding the segmenttaion results, do you want the segmentation mask to be saved separately? Or would like to have access to the annotations from the inferencer?

samet-akcay avatar Jul 11 '22 17:07 samet-akcay

@samet-akcay when running python tools/inference.py we can get the result that looks like image(1st image) But we would want to have an option for getting the segmentation result also (without overlay), it looks like below: image(2nd image) There is an argument: "--overlay_mask" in inference.py but when I set it to True then it will be saved as a result with both overlay and segmentation. image(3rd image)

We would also get segmentation results (like as 2nd image) when running inference. Could you tell us how to do it?

nguyenanhtuan1008 avatar Jul 12 '22 00:07 nguyenanhtuan1008

@wangk98, regarding the segmenttaion results, do you want the segmentation mask to be saved separately? Or would like to have access to the annotations from the inferencer?

yes, I want the segmentation mask to be saved separately. If possible, I would also like to be able to plot the PR curve and AUC curve directly

wangk98 avatar Jul 12 '22 02:07 wangk98

yes, I want the segmentation mask to be saved separately. If possible, I would also like to be able to plot the PR curve and AUC curve directly

You could follow PR #429 for metric visualization

samet-akcay avatar Jul 12 '22 10:07 samet-akcay

@nguyenanhtuan1008, have you tried the new inference? If you use tools/inference/lightning_inference.py, you could get that output. For instance, this is what I get when I use the new lightning inference 000

samet-akcay avatar Jul 12 '22 13:07 samet-akcay

Closing this due to inactivity. Fee free to re-open if you still encounter any issues.

samet-akcay avatar Aug 25 '22 07:08 samet-akcay

For me the tools/inference/lightning_inference.py won't work with cflow model

FaDavid98 avatar Sep 26 '22 10:09 FaDavid98

Could be related to #568. I'll check it out

samet-akcay avatar Sep 26 '22 11:09 samet-akcay

I am getting this error, while running lightning_inference.py with cflow model in superimpose_anomaly_map superimposed_map = cv2.addWeighted(anomaly_map, alpha, image, (1 - alpha), gamma) cv2.error: OpenCV(4.6.0) /io/opencv/modules/core/src/arithm.cpp:647: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'arithm_op'

Predicting DataLoader 0: 0%| | 0/1 [00:00<?, ?it/s]

FaDavid98 avatar Sep 26 '22 12:09 FaDavid98

I've just checked. This issue is related to #568. You could follow the progress there.

samet-akcay avatar Sep 26 '22 13:09 samet-akcay