Google Summer of Code 2023
Project: Anomaly Segmentation Metrics for anomalib
Organization: OpenVINO (https://github.com/openvinotoolkit/openvino)
Mentors: @samet-akcay, @djdameln
# %% | |
# Scratch of spro on a batch of images | |
import torch | |
# ---- Dummy data ---- | |
# a batch of predictions for two images | |
# shape: (2, 1, 256, 256) | |
predictions = torch.rand(2, 1, 256, 256) |
lightning_logs/ | |
.cache |
Google Summer of Code 2023
Project: Anomaly Segmentation Metrics for anomalib
Organization: OpenVINO (https://github.com/openvinotoolkit/openvino)
Mentors: @samet-akcay, @djdameln
""" | |
Source of the idea: https://stackoverflow.com/a/58491045/9582881 | |
""" | |
import numpy as np | |
def round_significant_digits(x, dtype=np.float64, precision=4): | |
string = np.format_float_positional(x, unique=False, fractional=False, trim='k', precision=precision) | |
return dtype(string) |