Spaces:
Sleeping
Sleeping
File size: 1,125 Bytes
689227c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import os
# Base directory for your project (automatically set to the script's directory)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# Configuration for Flask
HOST = '0.0.0.0' # or '0.0.0.0' for external access
IMAGE_REC_PORT = 4000 # Port number for your Flask app
# File directory paths
FILE_DIRECTORY = os.path.join(BASE_DIR, 'data') # Adjust according to your structure
# Directories for image processing
UPLOAD_FOLDER = os.path.join(FILE_DIRECTORY, 'image-rec', 'images')
ANNOTATED_IMAGES = os.path.join(FILE_DIRECTORY, 'image-rec', 'annotated_images')
ANNOTATED_ARCHIVE = os.path.join(FILE_DIRECTORY, 'image-rec', 'annotated_archive')
STITCHED_IMAGES = os.path.join(FILE_DIRECTORY, 'image-rec', 'stitched_images')
SAMPLE_IMAGES = os.path.join(FILE_DIRECTORY, 'image-rec', 'sample_images')
if __name__ == '__main__':
# Ensure all necessary directories exist
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
os.makedirs(ANNOTATED_IMAGES, exist_ok=True)
os.makedirs(ANNOTATED_ARCHIVE, exist_ok=True)
os.makedirs(STITCHED_IMAGES, exist_ok=True)
os.makedirs(SAMPLE_IMAGES, exist_ok=True)
|