Commit ·
62c06e0
1
Parent(s): 04e599a
Make tensorflow keras fixes again
Browse files- requirements.txt +0 -1
- src/nets/Loss.py +1 -3
- src/nets/vgg16.py +0 -1
- src/utils/callbacks.py +0 -1
- src/utils/dataloader.py +1 -1
requirements.txt
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
streamlit
|
| 2 |
numpy
|
| 3 |
tensorflow
|
| 4 |
-
keras
|
| 5 |
Pillow
|
|
|
|
| 1 |
streamlit
|
| 2 |
numpy
|
| 3 |
tensorflow
|
|
|
|
| 4 |
Pillow
|
src/nets/Loss.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
-
import os
|
| 2 |
import tensorflow as tf
|
| 3 |
-
from
|
| 4 |
-
import numpy as np
|
| 5 |
|
| 6 |
def multi_category_focal_loss2(gamma=2., alpha=1):
|
| 7 |
"""
|
|
|
|
|
|
|
| 1 |
import tensorflow as tf
|
| 2 |
+
from tensorflow.keras import backend as K
|
|
|
|
| 3 |
|
| 4 |
def multi_category_focal_loss2(gamma=2., alpha=1):
|
| 5 |
"""
|
src/nets/vgg16.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from tensorflow.keras.layers import Conv2D, Dense, Flatten, Input, MaxPooling2D
|
| 2 |
from tensorflow.keras.models import Model #导入包Conv2D是卷积核 Flatten是展开 Input输入 MaxPooling2D最大卷积核
|
| 3 |
|
| 4 |
-
|
| 5 |
def VGG16(input_shape=None, classes=1000): #def 就是开始定义VGG16的网络
|
| 6 |
img_input = Input(shape=input_shape) # 224, 224, 3
|
| 7 |
|
|
|
|
| 1 |
from tensorflow.keras.layers import Conv2D, Dense, Flatten, Input, MaxPooling2D
|
| 2 |
from tensorflow.keras.models import Model #导入包Conv2D是卷积核 Flatten是展开 Input输入 MaxPooling2D最大卷积核
|
| 3 |
|
|
|
|
| 4 |
def VGG16(input_shape=None, classes=1000): #def 就是开始定义VGG16的网络
|
| 5 |
img_input = Input(shape=input_shape) # 224, 224, 3
|
| 6 |
|
src/utils/callbacks.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
-
import tensorflow as tf
|
| 4 |
import matplotlib
|
| 5 |
matplotlib.use('Agg')
|
| 6 |
from matplotlib import pyplot as plt
|
|
|
|
| 1 |
import os
|
| 2 |
|
|
|
|
| 3 |
import matplotlib
|
| 4 |
matplotlib.use('Agg')
|
| 5 |
from matplotlib import pyplot as plt
|
src/utils/dataloader.py
CHANGED
|
@@ -4,7 +4,7 @@ from random import shuffle
|
|
| 4 |
import cv2
|
| 5 |
import tensorflow as tf
|
| 6 |
import numpy as np
|
| 7 |
-
from
|
| 8 |
from PIL import Image
|
| 9 |
|
| 10 |
from .utils import cvtColor, preprocess_input
|
|
|
|
| 4 |
import cv2
|
| 5 |
import tensorflow as tf
|
| 6 |
import numpy as np
|
| 7 |
+
from tensorflow.keras.utils import to_categorical
|
| 8 |
from PIL import Image
|
| 9 |
|
| 10 |
from .utils import cvtColor, preprocess_input
|