Spaces:
Sleeping
Sleeping
File size: 1,209 Bytes
1431308 | 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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import os
import sys
import logging
from pathlib import Path
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[logging.StreamHandler(sys.stdout)]
)
logger = logging.getLogger(__name__)
# Create placeholder for example images
def create_example_images():
"""
Create placeholder example images directory if it doesn't exist.
In production, you should replace these with actual example images.
"""
assets_dir = Path("assets")
assets_dir.mkdir(exist_ok=True)
# Check if example images exist, if not create placeholders
example_files = ["example1.jpg", "example2.jpg", "example3.jpg"]
for example in example_files:
example_path = assets_dir / example
if not example_path.exists():
logger.info(f"Example image {example} not found. Please add it to the assets directory.")
# Initialize the application
if __name__ == "__main__":
# Ensure example images are available
create_example_images()
# Import app after initialization
from app import create_ui
# Create and launch the app
app = create_ui()
app.launch()
|