Adjust constants

This commit is contained in:
2025-07-31 18:44:05 -06:00
parent aa8f87a6d3
commit 1b5fee77c2
3 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ from PIL import Image, ImageDraw
# For the custom crop transform. User can adjust these. # For the custom crop transform. User can adjust these.
TRIANGLE_CROP_WIDTH = 556 TRIANGLE_CROP_WIDTH = 556
TRIANGLE_CROP_HEIGHT = 1184 TRIANGLE_CROP_HEIGHT = 1184
RESIZE_DIM = 64 # Resize cropped image to this dimension (square) RESIZE_DIM = 256 # Resize cropped image to this dimension (square)
# Custom transform to crop a triangle from the lower right corner # Custom transform to crop a triangle from the lower right corner

View File

@@ -10,8 +10,8 @@ def main():
them into data/open/ or data/closed/ based on the 'choice' field. them into data/open/ or data/closed/ based on the 'choice' field.
""" """
data_dir = 'data' data_dir = 'data'
open_dir = os.path.join(data_dir, 'open') open_dir = os.path.join(data_dir, 'labelled/open')
closed_dir = os.path.join(data_dir, 'closed') closed_dir = os.path.join(data_dir, 'labelled/closed')
# This is an assumption based on the path found in the 'd' parameter of the image URL. # This is an assumption based on the path found in the 'd' parameter of the image URL.
# e.g., ...?d=.../data/hourly_photos/filename.jpg # e.g., ...?d=.../data/hourly_photos/filename.jpg

View File

@@ -14,7 +14,7 @@ def sort_images():
MODEL_PATH = 'garage_door_cnn.pth' MODEL_PATH = 'garage_door_cnn.pth'
SOURCE_DIR = 'data/hourly_photos/' SOURCE_DIR = 'data/hourly_photos/'
DEST_DIR = 'data/sorted/open/' DEST_DIR = 'data/sorted/open/'
CONFIDENCE_THRESHOLD = 0.90 # Only copy if confidence is over this value CONFIDENCE_THRESHOLD = 0.80 # Only copy if confidence is over this value
# The classes are sorted alphabetically by ImageFolder: ['closed', 'open'] # The classes are sorted alphabetically by ImageFolder: ['closed', 'open']