working generators + model tests

This commit is contained in:
Maciej Sobkowiak 2022-02-16 22:08:44 +01:00
parent 72852a7357
commit 59b2b9e687
5 changed files with 114 additions and 25 deletions

View File

@ -1,2 +1,3 @@
from consts import *
from helpers import *
from metrics import *

View File

@ -2,10 +2,10 @@ import pandas as pd
FEATURES ='../data/train_features'
LABELS = '../data/train_labels'
JPG_IMAGES = '../images'
RGB_DIR = "rgb"
FC_DIR = "fc"
MASK_DIR = "mask"
METADATA = pd.read_csv('../data/train_metadata.csv')
RGB_DIR = "rgb/img"
FC_DIR = "fc/img"
MASK_DIR = "mask/img"
# METADATA = pd.read_csv('../data/train_metadata.csv')
BATCH = 8
IMG_SIZE = (512,512)

View File

@ -1,5 +1,5 @@
import tensorflow as tf
from metrics import IOU
from src.metrics import IOU
class jaccard_loss(tf.keras.losses.Loss):

View File

@ -25,6 +25,5 @@ if __name__ == "__main__":
if(not os.path.exists(os.path.join(dp, d +'.jpeg')) or not os.path.exists(os.path.join(fc, d +'.jpeg')) or not os.path.exists(os.path.join(mk, d +'.jpeg'))):
convert_tif_to_jpg(os.path.join(FEATURES, d), os.path.join(LABELS, d + ".tif"), dp, fc, mk)
elif(sys.argv[1] == '--show'):
img_names = [random.choice(os.listdir(dp)) for _ in range(3)]
plot_image_grid(img_names)

File diff suppressed because one or more lines are too long