import os import sys def main(): """ Main script to run the training process. """ print("=== Plant Disease Model Training ===") # First, try to download the PlantVillage dataset print("Step 1: Downloading dataset") try: import download_plantvillage success = download_plantvillage.download_plantvillage_dataset() if success: print("Dataset downloaded successfully") else: print("Could not download dataset, will use synthetic data") except Exception as e: print(f"Error during dataset download: {e}") print("Will use synthetic data instead") # Train the model print("\nStep 2: Training model") try: import train_quick train_quick.train_quick_model() except Exception as e: print(f"Error during model training: {e}") sys.exit(1) print("\nTraining completed successfully!") print("You can now run the application with 'python app.py'") if __name__ == "__main__": main()