# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
# %matplotlib inline

# +


onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]

print(onlyfiles)


# +
def reshape_img(fl):
    fl_ = np.zeros((256,256,fl.shape[0]))
    for c in range(fl.shape[0]):
        fl_[:,:,c] = fl[c,:,:]
    return fl_

def clean_br(img):
    img = img - img.min()
    img = img/img.max()
    return img

def clean_fl(img):
    img = reshape_img(img)
    img_ = np.zeros_like(img)
    print(img.shape)
    print(img_.shape)
    for c in range(img.shape[-1]):
        img_[:,:,c] = img[:,:,c] - img[:,:,c].min()
        img_[:,:,c] = img_[:,:,c]/img_[:,:,c].max()
    return img_


# -

for i in range(len(onlyfiles)):
    data = np.load(mypath+onlyfiles[i])
    print(data[0].shape)

tf.test.is_gpu_available()



StarcoderdataJupyterScriptsDedupFiltered