witzit/witzit-load.py

66 lines
2.4 KiB
Python
Executable File

#!/usr/bin/python3
#
# witzit-load.py
#
# Copyright (C) 2022, Jeff Moe
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# wz-load
# Load a sample from a SciAps LIBS
#
# Sample files can be found here:
# https://ordar.otelo.univ-lorraine.fr/record?id=10.24396/ORDAR-65
#
# Usage:
# witzit-load.py
# Example:
# witzit-load.py
import os
import json
import numpy as np
import pandas as pd
import datetime
import tensorflow as tf
import tensorflow.python.keras
import matplotlib.pyplot as plt
from tensorflow.keras.layers import Dense, Conv2D, Flatten, Dropout, MaxPooling2D
from tensorflow.python.keras import optimizers
from tensorflow.python.keras import Sequential
from tensorflow.python.keras.layers import Activation, Dropout, Flatten, Dense
from tensorflow.python.keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D
from tensorflow.python.keras.layers import Input, concatenate
from tensorflow.python.keras.models import load_model
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.preprocessing import image
from tensorflow.python.keras.preprocessing.image import img_to_array
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from tensorflow.python.keras.preprocessing.image import load_img
# from tensorflow.python.keras.utils import plot_model
from tensorflow.python.keras.callbacks import ModelCheckpoint
print("Tensorflow Version: ", tf.__version__)
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices("GPU")))
print("Num CPUs Available: ", len(tf.config.experimental.list_physical_devices("CPU")))
print(tf.config.experimental.list_physical_devices())
file_url = "samples/BAJ4B-S4b/BAJ4B-S4b_20200504_095456_AM_Spectrum_PixelData.csv"
# Read with panda for now...
dataframe = pd.read_csv(file_url)
print(dataframe)