from utils.elpv_reader import load_dataset
import cv2
import numpy as np
import shutil
import os
from sklearn.model_selection import train_test_split

destination_folder = 'solar_panels_products_V2'

if not os.path.exists(destination_folder):
    os.mkdir(destination_folder)

# datafolder is the relative path for the contents in the elpv dataset

images, probs, types = load_dataset(datafolder='elpv_dataset')

train_images, test_images, train_probs, test_probs, train_types, test_types = train_test_split(
    images, probs, types, test_size=0.1)


def create_dataset(images, probs, types, split):

    threshold = 0.6

    data_folder = os.path.join(destination_folder, split)

    if not os.path.exists(data_folder):
        os.mkdir(data_folder)

    idx = 0
Ejemplo n.º 2
0
#!/usr/bin/env python
# coding: utf-8

# In[1]:

import tensorflow as tf
import numpy as np
from matplotlib import pyplot as plt

# In[2]:

from utils.elpv_reader import load_dataset
images, proba, types = load_dataset()

# In[3]:

import matplotlib.pyplot as plt
from tensorflow.keras import datasets, layers, models
height = 200

# In[4]:

images = images / 255.
images = images.reshape(2624, height, height, 1)

# In[5]:

model = models.Sequential()

model.add(
    layers.Conv2D(64, (7, 7),