Skip to content

Commit

Permalink
Minor Tweaks, easier arguments + documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanner Swanson committed Feb 13, 2025
1 parent d60f327 commit 9cc7468
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9cc7468

Please sign in to comment.