forked from DonaldRR/SimpleNet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
53 lines (48 loc) · 1.52 KB
/
run.sh
File metadata and controls
53 lines (48 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Example: use a custom dataset with an MVTec-like folder structure.
# Point datapath to either the dataset root (containing train/test/ground_truth)
# or any nested folder like train/good — the loader walks up to find the root.
# Update the class name in datasets (e.g., 'zipper' below) to label results.
# Tip (Windows + Git Bash): prefer POSIX-style paths like /c/Users/Name/...
# Example below points to a folder within this repo; change as needed.
datapath="/c/Users/Peter Peng/Downloads/dummy/SimpleNet/data/zipper/"
datasets=('zipper')
# Build flags as an array: [-d, <name>, -d, <name>, ...]
dataset_flags=()
for dataset in "${datasets[@]}"; do
dataset_flags+=("-d" "$dataset")
done
# Pick a Python interpreter (prefer venv, then python3, then python)
PYTHON="python3"
if [ -x ".venv/bin/python" ]; then
PYTHON=".venv/bin/python"
elif [ -x ".venv/Scripts/python.exe" ]; then
PYTHON=".venv/Scripts/python.exe"
elif ! command -v python3 >/dev/null 2>&1 && command -v python >/dev/null 2>&1; then
PYTHON="python"
fi
"$PYTHON" main.py \
--gpu 4 \
--seed 0 \
--log_group simplenet_mvtec \
--log_project MVTecAD_Results \
--results_path results \
--run_name run \
net \
-b wideresnet50 \
-le layer2 \
-le layer3 \
--pretrain_embed_dimension 1536 \
--target_embed_dimension 1536 \
--patchsize 3 \
--meta_epochs 40 \
--embedding_size 256 \
--gan_epochs 4 \
--noise_std 0.015 \
--dsc_hidden 1024 \
--dsc_layers 2 \
--dsc_margin .5 \
--pre_proj 1 \
dataset \
--batch_size 8 \
--resize 329 \
--imagesize 288 "${dataset_flags[@]}" custom "$datapath"