Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rishavpramanik authored Feb 23, 2022
1 parent 59a2f63 commit 8ec06a6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import argparse
import numpy as np
from utils.generate_csv import generate_csv
from utils.k_fold_splits import k_fold_splits
from utils.k_fold_separate import k_fold_separate
from utils.generate_csv import generate_csv
from utils.k_fold_splits import k_fold_splits
from utils.k_fold_separate import k_fold_separate

parser = argparse.ArgumentParser()
parser.add_argument('--num_epochs', type=int, default = 70,
help='Number of Epochs for training')
parser.add_argument('--path', type=str, default = './',
parser.add_argument('--path', type=str, default = './',
help='Path where the image data is stored')
parser.add_argument('--batch_size', type=int, default = 16,
help='Batch Size for Mini Batch Training')
Expand All @@ -18,21 +18,21 @@
df = generate_csv(args.path)

y = np.array(list(df["class"]))
x = np.array(list( df["path"]))
x = np.array(list( df["path"]))

files_for_train_x = []
files_for_validation_x = []
files_for_validation_x = []
files_for_train_y = []
files_for_validation_y = []

k_fold_splits(x,y, files_for_train_x , files_for_validation_x ,
files_for_train_y , files_for_validation_y ) # n_splits = 5
files_for_train_y , files_for_validation_y ) # n_splits = 5

#n is the number of folds
n = len(files_for_train_x)
for i in range(0,n):
N = len(files_for_train_x)
for i in range(0,N):
k_fold_separate(files_for_train_x[i] , files_for_train_y[i] ,
files_for_validation_x[i] ,files_for_validation_y[i] ,
"InceptionV3" , "MobileNetV2" ,"InceptionResNetV2" ,i+1 ,
NUM_EPOCHS = args.num_epochs , train_batch=args.batch_size ,
validation_batch = args.batch_size, lr=args.lr)
validation_batch = args.batch_size, lr=args.lr)

0 comments on commit 8ec06a6

Please sign in to comment.