talafek96 / Diffusion-AD-Project

In this project we will attempt to develop a POC for detecting anomalies in images based on the ability or inability of a DDM to reconstruct them.
1 stars 1 forks source link

DF-MANAGER: Renamed #28

Closed amitir22 closed 1 year ago

amitir22 commented 1 year ago

Contents of PR:

Rename the file and the class and all instances of the word 'results' to 'data' or 'DataFrame'. Add more default columns: 'noise_timesteps', 'vmin', 'vmax'. Create separate dataframe managers; One for managing results, and the other for managing vmin, vmax per category and timesteps. Implement usage of the new columns.

talafek96 commented 1 year ago
calculate 10% percentile and 90% percentile of current amap
if category, timesteps not in data:
    if current image is with an anomaly (according to test label):
        df[df.category == .., df.num_timesteps == ..].vmin <- 10% percentile,   df[df.category == .., df.num_timesteps == ..] <- 90% percentile
        return df.vmin, df.vmax  
    return default vmin, vmax

otherwise,
if the current image is with an anomaly (according to the test label):
    In the df, add to the average of the corresponding vmin the result of the 10% percentile and do the same with vmax and the 90% percentile
return the corresponding vmin, vmax results from the df