專案

一般

配置概況

Bug #66 » rgb_distrbution.py

建誠 林, 2023-11-02 00:23

 
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
from keras.models import load_model
import os
from plot import plot
import openpyxl
from dataInput_creatMask import dataInput_creatMask_rgb
# ???
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE"

input_folder_1 = 'C:/Users/DELL/Desktop/NTUT_project/rgb_test/ttt/'
model_where = './model/model_0501.h5'

folder_1_analyze_data = dataInput_creatMask_rgb(input_folder_1,model_where)
wb = openpyxl.load_workbook('avg.xlsx')
s1 = wb['工作表1']

if type(folder_1_analyze_data) is dict:
for i in range(np.size(folder_1_analyze_data["R_avg"])):
print(folder_1_analyze_data["R_avg"][i]["file_name"])
print(folder_1_analyze_data["R_avg"][i]["data"] - folder_1_analyze_data["G_B_avg"][i]["data"])
s1.cell(1,i+1).value = folder_1_analyze_data["R_avg"][i]["file_name"]
s1.cell(2,i+1).value = folder_1_analyze_data["R_avg"][i]["data"] - folder_1_analyze_data["G_B_avg"][i]["data"]
s1.cell(3,i+1).value = folder_1_analyze_data["r_minus_gb_avg_withoutmax"][i]["data"]
wb.save('test.xlsx')
else:
if type(folder_1_analyze_data) is str:
print(folder_1_analyze_data)
(6-6/6)