Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Atashnezhad committed Aug 26, 2023
1 parent d1c77d2 commit 1aad52b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
15 changes: 13 additions & 2 deletions neural_network_model/bit_vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,22 @@
import tensorflow as tf
from keras import Sequential
from keras.callbacks import ModelCheckpoint
from keras.layers import BatchNormalization, Conv2D, Dense, Dropout, Flatten, MaxPooling2D
from keras.layers import (
BatchNormalization,
Conv2D,
Dense,
Dropout,
Flatten,
MaxPooling2D,
)
from tensorflow import keras
from tensorflow.keras.applications.resnet50 import decode_predictions, preprocess_input
from tensorflow.keras.preprocessing import image
from tensorflow.keras.preprocessing.image import ImageDataGenerator, img_to_array, load_img
from tensorflow.keras.preprocessing.image import (
ImageDataGenerator,
img_to_array,
load_img,
)

from neural_network_model.model import SETTING

Expand Down
6 changes: 5 additions & 1 deletion neural_network_model/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

from bing_image_downloader import downloader
from tensorflow.keras.preprocessing import image
from tensorflow.keras.preprocessing.image import ImageDataGenerator, img_to_array, load_img
from tensorflow.keras.preprocessing.image import (
ImageDataGenerator,
img_to_array,
load_img,
)
from tqdm import tqdm

from neural_network_model.model import SETTING
Expand Down
14 changes: 8 additions & 6 deletions neural_network_model/transfer_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,7 @@ def predict_one_image(self, img_path: str):
:return: None
"""
# Load the image
img = tf.keras.preprocessing.image.load_img(
img_path, target_size=(224, 224)
)
img = tf.keras.preprocessing.image.load_img(img_path, target_size=(224, 224))
# Convert the image to array
img_array = tf.keras.preprocessing.image.img_to_array(img)
# Expand the dimension of the image
Expand Down Expand Up @@ -1017,7 +1015,11 @@ def predict_one_image(self, img_path: str):
transfer_model.grad_cam_viz(num_rows=3, num_cols=2)

transfer_model.predict_one_image(
img_path=str(Path(__file__).parent / ".." / "dataset_ad" / "MildDemented" / "mildDem0.jpg"),
img_path=str(
Path(__file__).parent
/ ".."
/ "dataset_ad"
/ "MildDemented"
/ "mildDem0.jpg"
),
)


5 changes: 4 additions & 1 deletion neural_network_model/visual_insights.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
from sklearn.cluster import KMeans
from tqdm import tqdm

from neural_network_model.model import SUPERVISE_LEARNING_SETTING, TRANSFER_LEARNING_SETTING
from neural_network_model.model import (
SUPERVISE_LEARNING_SETTING,
TRANSFER_LEARNING_SETTING,
)

# ignore warnings
warnings.filterwarnings("ignore")
Expand Down

0 comments on commit 1aad52b

Please sign in to comment.