Open J-WBaek opened 3 months ago
medical image prediction 코드 입니다.
import numpy as np # forlinear algebra
import matplotlib.pyplot as plt #for plotting things
import os
from PIL import Image # for reading images
from tensorflow import keras
from tensorflow.keras.preprocessing.image import ImageDataGenerator, load_img
#from sklearn.metrics import classification_report, confusion_matrix # <- define evaluation metrics
test_datagen = ImageDataGenerator(rescale = 1./255) #Image normalization.
test_set = test_datagen.flow_from_directory('./chest_xray/test',
target_size = (64, 64),
batch_size = 32,
class_mode = 'binary')
model_fin = keras.models.load_model('./medical_ann.h5')
test_accu = model_fin.evaluate(test_set, steps=624)
print('The testing accuracy is :',test_accu[1]*100, '%')
# label 얻기
labels = test_set.labels
Y_pred = model_fin.predict(test_set)
#y_pred = np.argmax(Y_pred)
y_pred = []
for yy in Y_pred:
if yy >= 0.5:
y_pred.append(1)
else:
y_pred.append(0)
class_name = ["NORMAL", "PNEUMONIA"]
print("actual || predict")
for i in range(624):
if i%10 == 0:
print(class_name[labels[i]], end=" || ")
print(class_name[y_pred[i]], end='\n')
1. 실습 폴더 구성
2. 새로운 Issue 생성
3. 작업한 내용으로 Commit 생성 후, 하기 branch 이름 규칙으로 class repo에 PR생성
4. Push 후 생성한 Issue에
Development
에 생성한 PR 등록reviewer를 J-WBaek로 설정 예제)
5. Reviewer의 feedback에 의거 재작업 혹은 conflict 발생시 재작업 후 re-push
6. Reviewer의 승인 후에 하기와 같이 Merge
참고) https://github.com/pskcci/intel-01/issues/3#issue-2122172755
troubleshooting.
git push를 해도 반응이 없다 (변동사항이 없다고 인식해서 branch 로그에 반영 해줘야 함). ** git status를 눌러 git add . -> git commit -m "~~"
push 진행시 에러가 뜬다 (메인과 branch 로그가 달라서 한번 일치시켜야 함). ** git pull 로 한번 당겨온 후 git push