From 9cc7468fea1425c3e320d414f48715653cd076a0 Mon Sep 17 00:00:00 2001 From: Tanner Swanson Date: Thu, 13 Feb 2025 13:35:52 -0500 Subject: [PATCH] Minor Tweaks, easier arguments + documentation --- .gitignore | 14 ++++++++++++++ main.py | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..026c945 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# Created by venv; see https://docs.python.org/3/library/venv.html +ShipD/ +ShipGen/ +Scripts/ +Lib/ +Include/ +share/ +TrainingData/* +OutputData/* +anomaly_map.png +originaly_map.png +pyvenv.cfg +modified_model.stl +sample_Hull_Mesh.stl \ No newline at end of file diff --git a/main.py b/main.py index 2376cab..841e420 100644 --- a/main.py +++ b/main.py @@ -44,10 +44,10 @@ def run_detection(fileLocation, clip): 'log_kernel': 1.5 # LoG kernel size } anomaly_map_value = get_anomaly_map(npArray, params) - if (clip == 1): + if (clip == 1): #clips to [0, 1] anomaly_map_value = np.clip(anomaly_map_value, 0, 1) # limit range from 0 - 1. If outside, round to that value - elif (clip == 2): + elif (clip == 2): #binary anomaly_map_value = np.where(anomaly_map_value >= 0.5, 1, 0) # set value to either 0 or 1. rounds up if >= 0.5, else down return (npArray, anomaly_map_value) # returns original, and analyzed version for comparison.