Skip to content

Commit

Permalink
fix the file format issue, including the jpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
Atashnezhad committed Aug 25, 2023
1 parent 9e49471 commit cc63fc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions neural_network_model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ class Config:
# Allow extra fields in the model (to ignore the pydantic ConfigError)
extra = Extra.allow

SUPPORTED_FILE_FORMATS: list = [
".jpg",
".jpeg",
".png",
".bmp",
".tif",
".tiff",
".gif",
]


class localBinaryPatterns(BaseModel):
NUM_POINTS: int = 8
Expand Down
2 changes: 1 addition & 1 deletion neural_network_model/transfer_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def plot_data_images(
filepath = self.image_df.Filepath[i]
file_extension = os.path.splitext(filepath)[1].lower()

if file_extension in [".png", ".jpg"]:
if file_extension in TRANSFER_LEARNING_SETTING.SUPPORTED_FILE_FORMATS:
try:
image = plt.imread(filepath)
ax.imshow(image, cmap=cmap)
Expand Down

0 comments on commit cc63fc7

Please sign in to comment.