diff --git a/server/deep_learning.R b/server/deep_learning.R index a08797c..a2f88fe 100644 --- a/server/deep_learning.R +++ b/server/deep_learning.R @@ -44,7 +44,6 @@ deep_learning = function() { # --- For Inference Tab --- obj_inference_result <- reactiveVal(list(status = "Ready", image_url = NULL, error = NULL)) - asr_inference_result <- reactiveVal(list(status = "Ready", transcription = NULL, error = NULL)) img_class_inference_result <- reactiveVal(list(status = "Ready", prediction = NULL, error = NULL)) seg_inference_result <- reactiveVal(list(status = "Ready", image_url = NULL, error = NULL)) @@ -76,13 +75,11 @@ deep_learning = function() { observe({ task <- input$task_selector if (task == "object_detection") { - shinyjs::show("obj_panel"); shinyjs::hide("asr_panel"); shinyjs::hide("img_class_panel"); shinyjs::hide("seg_panel") - } else if (task == "asr") { - shinyjs::hide("obj_panel"); shinyjs::show("asr_panel"); shinyjs::hide("img_class_panel"); shinyjs::hide("seg_panel") + shinyjs::show("obj_panel"); shinyjs::hide("img_class_panel"); shinyjs::hide("seg_panel") } else if (task == "image_classification") { - shinyjs::hide("obj_panel"); shinyjs::hide("asr_panel"); shinyjs::show("img_class_panel"); shinyjs::hide("seg_panel") + shinyjs::hide("obj_panel"); shinyjs::show("img_class_panel"); shinyjs::hide("seg_panel") } else if (task == "image_segmentation") { - shinyjs::hide("obj_panel"); shinyjs::hide("asr_panel"); shinyjs::hide("img_class_panel"); shinyjs::show("seg_panel") + shinyjs::hide("obj_panel"); shinyjs::hide("img_class_panel"); shinyjs::show("seg_panel") } }) @@ -96,9 +93,6 @@ deep_learning = function() { if (task_slug == "object_detection") { arch_choices <- names(model_registry()$object_detection) updateSelectInput(session, "obj_model_arch", choices = arch_choices) - } else if (task_slug == "asr") { - arch_choices <- names(model_registry()$asr) - updateSelectInput(session, "asr_model_arch", choices = arch_choices) } else if (task_slug == "image_classification") { arch_choices <- names(model_registry()$image_classification) updateSelectInput(session, "img_class_model_arch", choices = arch_choices) @@ -114,11 +108,6 @@ deep_learning = function() { checkpoints <- model_registry()$object_detection[[input$obj_model_arch]] updateSelectInput(session, "obj_model_checkpoint", choices = checkpoints) }) - observeEvent(input$asr_model_arch, { - req(model_registry(), input$asr_model_arch, input$asr_model_arch != "Loading...") - checkpoints <- model_registry()$asr[[input$asr_model_arch]] - updateSelectInput(session, "asr_model_checkpoint", choices = checkpoints) - }) observeEvent(input$img_class_model_arch, { req(model_registry(), input$img_class_model_arch, input$img_class_model_arch != "Loading...") checkpoints <- model_registry()$image_classification[[input$img_class_model_arch]] @@ -156,8 +145,6 @@ deep_learning = function() { task_slug <- input$task_selector if (task_slug == "object_detection") { updateSelectInput(session, "obj_dataset_id", choices = load_datasets_for_task("object_detection")) - } else if (task_slug == "asr") { - updateSelectInput(session, "asr_dataset_id", choices = load_datasets_for_task("asr")) } else if (task_slug == "image_classification") { updateSelectInput(session, "img_class_dataset_id", choices = load_datasets_for_task("image_classification")) } else if (task_slug == "image_segmentation") { @@ -235,7 +222,7 @@ deep_learning = function() { refresh_data_trigger() # React to the trigger tryCatch({ - tasks <- c("object_detection", "asr", "image_classification", "image_segmentation") + tasks <- c("object_detection", "image_classification", "image_segmentation") all_datasets <- lapply(tasks, function(task) { req <- request(paste0(api_url, "/data/list/", task)) resp_data <- resp_body_json(req_perform(req), simplifyVector = TRUE) @@ -321,80 +308,7 @@ deep_learning = function() { }) }) - # --- 4.2: ASR Job --- - observeEvent(input$start_asr_job, { - req(input$asr_dataset_id, input$asr_model_checkpoint) - reset_live_training_ui("ASR") - - outlier_val <- input$outlier_std_devs - if (is.null(outlier_val) || is.na(outlier_val) || !is.numeric(outlier_val) || !input$asr_apply_outlier_filtering) { - outlier_val <- 2.0 - } - - max_hours <- if (is.na(input$asr_max_train_hours) || is.null(input$asr_max_train_hours)) NULL else as.character(input$asr_max_train_hours) - - tryCatch({ - req_list <- list( - dataset_id = as.character(input$asr_dataset_id), - model_checkpoint = as.character(input$asr_model_checkpoint), - run_name = as.character(input$asr_run_name), - version = as.character(input$asr_version), - language = as.character(input$asr_language), - language_code = as.character(input$asr_language_code), - speaker_id_column = as.character(input$asr_speaker_id_column), - text_column = as.character(input$asr_text_column), - target_sampling_rate = as.character(input$asr_target_sampling_rate), - min_duration_s = as.character(input$asr_min_duration_s), - max_duration_s = as.character(input$asr_max_duration_s), - min_transcript_len = as.character(input$asr_min_transcript_len), - max_transcript_len = as.character(input$asr_max_transcript_len), - apply_outlier_filtering = as.character(input$asr_apply_outlier_filtering), - outlier_std_devs = as.character(outlier_val), - is_presplit = as.character(input$asr_is_presplit), - speaker_disjointness = as.character(input$asr_speaker_disjointness), - train_ratio = as.character(input$asr_train_ratio), - dev_ratio = as.character(input$asr_dev_ratio), - test_ratio = as.character(input$asr_test_ratio), - epochs = as.character(input$asr_epochs), - learning_rate = as.character(input$asr_learning_rate), - lr_scheduler_type = as.character(input$asr_lr_scheduler_type), - warmup_ratio = as.character(input$asr_warmup_ratio), - train_batch_size = as.character(input$asr_train_batch_size), - eval_batch_size = as.character(input$asr_eval_batch_size), - gradient_accumulation_steps = as.character(input$asr_gradient_accumulation_steps), - gradient_checkpointing = as.character(input$asr_gradient_checkpointing), - optimizer = as.character(input$asr_optimizer), - early_stopping_patience = as.character(input$asr_early_stopping_patience), - early_stopping_threshold = as.character(input$asr_early_stopping_threshold), - push_to_hub = as.character(input$asr_push_to_hub), - hub_user_id = as.character(input$asr_hub_user_id), - hub_private_repo = as.character(input$asr_hub_private_repo), - log_to_wandb = as.character(input$asr_log_to_wandb), - wandb_project = as.character(input$asr_wandb_project), - wandb_entity = as.character(input$asr_wandb_entity), - seed = as.character(input$asr_seed), - num_proc = as.character(input$asr_num_proc), - max_train_hours = max_hours - ) - - req_list <- req_list[!sapply(req_list, is.null)] - - req <- request(paste0(api_url, "/train/asr")) %>% - req_body_multipart(!!!req_list) - - resp <- req_perform(req) - resp_data <- resp_body_json(resp) - active_job_id(resp_data$job_id) - polled_data(list(status = "Queued", task = "ASR", log = "Job is queued.")) - - }, error = function(e) { - error_message <- as.character(e$message) - if(!is.null(e$body)) { error_message <- paste("API Error:", e$body) } - polled_data(list(status = "Error", task = "ASR", log = error_message)) - }) - }) - - # --- 4.3: Image Classification Job --- + # --- 4.2: Image Classification Job --- observeEvent(input$start_img_class_job, { req(input$img_class_dataset_id, input$img_class_model_checkpoint) reset_live_training_ui("Image Classification") @@ -435,7 +349,7 @@ deep_learning = function() { }) }) - # --- 4.4: Image Segmentation Job --- + # --- 4.3: Image Segmentation Job --- observeEvent(input$start_seg_job, { req(input$seg_dataset_id, input$seg_model_checkpoint) reset_live_training_ui("Image Segmentation") @@ -906,23 +820,6 @@ deep_learning = function() { } }) - observeEvent(input$infer_asr_run_name, { - run_name <- input$infer_asr_run_name - if (nchar(run_name) > 2) { - tryCatch({ - req <- request(paste0(api_url, "/checkpoints")) %>% - req_url_query(run_name = run_name, task_type = "asr") - resp <- req_perform(req) - if (resp_status(resp) == 200) { - checkpoints <- resp_body_json(resp, simplifyVector = TRUE) - updateSelectInput(session, "infer_asr_checkpoint_dropdown", choices = checkpoints) - } - }, error = function(e) { - updateSelectInput(session, "infer_asr_checkpoint_dropdown", choices = c("Error finding checkpoints")) - }) - } - }) - observeEvent(input$infer_img_class_run_name, { run_name <- input$infer_img_class_run_name if (nchar(run_name) > 2) { @@ -971,26 +868,6 @@ deep_learning = function() { }) }) - observeEvent(input$start_asr_inference, { - req(input$infer_asr_audio_upload) - req(input$infer_asr_checkpoint_dropdown) - asr_inference_result(list(status = "Running...", transcription = "Processing...", error = NULL)) - tryCatch({ - req <- request(paste0(api_url, "/inference/asr")) %>% - req_body_multipart( - audio = curl::form_file(input$infer_asr_audio_upload$datapath), - model_checkpoint = input$infer_asr_checkpoint_dropdown - ) - resp <- req_perform(req) - resp_data <- resp_body_json(resp) - asr_inference_result(list(status = "Success", transcription = resp_data$transcription, error = NULL)) - }, error = function(e) { - error_message <- as.character(e$message) - if(!is.null(e$body)) { error_message <- paste("API Error:", e$body) } - asr_inference_result(list(status = "Error", transcription = NULL, error = error_message)) - }) - }) - observeEvent(input$start_img_class_inference, { req(input$infer_img_class_upload, input$infer_img_class_checkpoint_dropdown) img_class_inference_result(list(status = "Running...", prediction = "Processing...", error = NULL)) @@ -1045,23 +922,6 @@ deep_learning = function() { list(src = temp_file, contentType = 'image/jpeg', alt = "Inference Result") }, deleteFile = TRUE) - output$asr_inference_status_ui <- renderUI({ - res <- asr_inference_result() - if (res$status == "Running...") { - tags$div(class = "alert alert-info", "Running inference...") - } else if (res$status == "Error") { - tags$div(class = "alert alert-danger", HTML(paste("Error:", res$error))) - } - }) - output$asr_transcription_output <- renderText({ - res <- asr_inference_result() - if (is.null(res$transcription)) { - "Upload an audio file and click 'Run Inference' to see the transcription here." - } else { - res$transcription - } - }) - output$img_class_inference_status_ui <- renderUI({ res <- img_class_inference_result() if (res$status == "Running...") tags$div(class = "alert alert-info", "Running inference...") diff --git a/ui/deeplearning_ui.R b/ui/deeplearning_ui.R index 284c047..80837fd 100644 --- a/ui/deeplearning_ui.R +++ b/ui/deeplearning_ui.R @@ -21,8 +21,7 @@ deeplearning_ui = function() { width = 4, h4("Task Configuration"), selectInput("task_selector", "Select Task:", - choices = c("Object Detection" = "object_detection", - "ASR" = "asr", + choices = c("Object Detection" = "object_detection", "Image Classification" = "image_classification", "Image Segmentation" = "image_segmentation") ), @@ -42,7 +41,7 @@ deeplearning_ui = function() { # --- Training Parameters (Conditional) --- # These are for Transformers-based models conditionalPanel( - condition = "input.obj_model_arch != 'YOLO'", + condition = "input.obj_model_arch != 'YOLO' && input.obj_model_arch != 'RT-DETR'", collapsible_panel("Training Parameters (Transformers)", open = FALSE, numericInput("obj_learning_rate", "Learning Rate", 5e-5, step = 1e-6), numericInput("obj_weight_decay", "Weight Decay", 1e-4, step = 1e-5), @@ -50,10 +49,10 @@ deeplearning_ui = function() { numericInput("obj_max_grad_norm", "Max Gradient Norm", 1.0, min = 0.1, step = 0.1) ) ), - # --- NEW: YOLO-specific Parameters --- + # --- Ultralytics-specific Parameters (YOLO and RT-DETR) --- conditionalPanel( - condition = "input.obj_model_arch == 'YOLO'", - collapsible_panel("Training Parameters (YOLO)", open = FALSE, + condition = "input.obj_model_arch == 'YOLO' || input.obj_model_arch == 'RT-DETR'", + collapsible_panel("Training Parameters (YOLO / RT-DETR)", open = FALSE, # --- ADDED NEW INPUTS --- numericInput("obj_yolo_warmup_epochs", "Warmup Epochs", 3.0, min = 0, step = 0.1), numericInput("obj_yolo_lr0", "Initial Learning Rate (lr0)", 0.01, min = 0, step = 0.001), @@ -74,7 +73,7 @@ deeplearning_ui = function() { numericInput("obj_num_proc", "Number of Processes", 4, min = 0), checkboxInput("obj_force_preprocess", "Force Data Pre-processing", value = FALSE), conditionalPanel( - condition = "input.obj_model_arch != 'YOLO'", + condition = "input.obj_model_arch != 'YOLO' && input.obj_model_arch != 'RT-DETR'", checkboxInput("obj_gradient_checkpointing", "Enable Gradient Checkpointing (Saves Memory)", value = FALSE), checkboxInput("obj_fp16", "Use FP16 Precision (Unstable)", value = TRUE) ) @@ -82,7 +81,7 @@ deeplearning_ui = function() { collapsible_panel("Saving & Early Stopping", open = FALSE, numericInput("obj_early_stopping_patience", "Early Stopping Patience", 5), conditionalPanel( - condition = "input.obj_model_arch != 'YOLO'", + condition = "input.obj_model_arch != 'YOLO' && input.obj_model_arch != 'RT-DETR'", numericInput("obj_early_stopping_threshold", "Early Stopping Threshold", 0.0, step = 1e-4) ) ), @@ -103,87 +102,6 @@ deeplearning_ui = function() { ) ), - # --- ASR Training UI --- - shinyjs::hidden( - div( - id = "asr_panel", - h5("ASR Training", style="font-weight:bold; margin-top:20px; border-bottom: 1px solid #ddd; padding-bottom: 5px;"), - collapsible_panel("Paths & Naming", open = TRUE, - selectInput("asr_dataset_id", "Select Dataset", choices = c("Loading..." = "")), - selectInput("asr_model_arch", "Select Architecture", choices = c("Loading..." = "")), - selectInput("asr_model_checkpoint", "Select Checkpoint", choices = NULL), - textInput("asr_run_name", "Run Name", "shiny-asr-run"), - textInput("asr_version", "Version", "1.0.0") - ), - collapsible_panel("Data Splitting", open = FALSE, - checkboxInput("asr_is_presplit", "Is Data Pre-Split?", TRUE), - conditionalPanel( - condition = "input.asr_is_presplit == false", - checkboxInput("asr_speaker_disjointness", "Ensure Speaker Disjoint Split (if not pre-split)", FALSE), - numericInput("asr_train_ratio", "Train Ratio", 0.8, min = 0, max = 1), - numericInput("asr_dev_ratio", "Dev Ratio", 0.1, min = 0, max = 1), - numericInput("asr_test_ratio", "Test Ratio", 0.1, min = 0, max = 1) - ) - ), - collapsible_panel("Dataset & Language", open = FALSE, - conditionalPanel( - condition = "input.asr_model_arch == 'Whisper'", - textInput("asr_language", "Language (for Whisper)", "english"), - textInput("asr_language_code", "Language Code (for Whisper)", "en") - ), - textInput("asr_speaker_id_column", "Speaker ID Column (for disjoint split)", ""), - textInput("asr_text_column", "Text/Transcript Column", "sentence") - ), - collapsible_panel("Preprocessing & Filtering", open = FALSE, - numericInput("asr_target_sampling_rate", "Target Sampling Rate", 16000), - numericInput("asr_min_duration_s", "Min Duration (s)", 1.0), - numericInput("asr_max_duration_s", "Max Duration (s)", 30.0), - numericInput("asr_min_transcript_len", "Min Transcript Length", 10), - numericInput("asr_max_transcript_len", "Max Transcript Length", 300), - checkboxInput("asr_apply_outlier_filtering", "Apply Outlier Filtering", TRUE), - conditionalPanel( - condition = "input.asr_apply_outlier_filtering == true", - numericInput("asr_outlier_std_devs", "Outlier Std Devs", 2.0) - ) - ), - collapsible_panel("Training Parameters", open = FALSE, - numericInput("asr_max_train_hours", "Max Train Hours (Optional)", value = NA, min = 0), - numericInput("asr_epochs", "Epochs", 5, min = 1), - numericInput("asr_learning_rate", "Learning Rate", 3e-4, step = 1e-5), - selectInput("asr_lr_scheduler_type", "LR Scheduler", choices = c("linear", "cosine", "constant")), - numericInput("asr_warmup_ratio", "Warmup Ratio", 0.1), - numericInput("asr_train_batch_size", "Train Batch Size", 16), - numericInput("asr_eval_batch_size", "Eval Batch Size", 16), - numericInput("asr_gradient_accumulation_steps", "Gradient Accumulation", 1), - selectInput("asr_optimizer", "Optimizer", choices = c("adamw_torch", "adamw_hf", "adafactor")) - ), - collapsible_panel("Execution & Reproducibility", open = FALSE, - numericInput("asr_seed", "Seed", 42), - numericInput("asr_num_proc", "Number of Processes", 8), - checkboxInput("asr_gradient_checkpointing", "Enable Gradient Checkpointing", value = FALSE) - ), - collapsible_panel("Saving & Early Stopping", open = FALSE, - numericInput("asr_early_stopping_patience", "Early Stopping Patience", 5), - numericInput("asr_early_stopping_threshold", "Early Stopping Threshold", 1e-3) - ), - collapsible_panel("Hub & Logging", open = FALSE, - checkboxInput("asr_push_to_hub", "Push to Hub", FALSE), - conditionalPanel( - condition = "input.asr_push_to_hub == true", - textInput("asr_hub_user_id", "Hub User/Org Name", ""), - checkboxInput("asr_hub_private_repo", "Private Hub Repo", FALSE) - ), - checkboxInput("asr_log_to_wandb", "Log to W&B", FALSE), - conditionalPanel( - condition = "input.asr_log_to_wandb == true", - textInput("asr_wandb_project", "W&B Project", ""), - textInput("asr_wandb_entity", "W&B Entity", "") - ) - ), - actionButton("start_asr_job", "Start ASR Job", class = "btn-success", style="margin-top: 15px; width: 100%;") - ) - ), - # -- Image Classification UI -- shinyjs::hidden( div( @@ -309,7 +227,6 @@ deeplearning_ui = function() { textInput("new_data_name", "Dataset Name (e.g., 'my-coco-dataset')"), selectInput("new_data_task_type", "Task Type", choices = c("Object Detection" = "object_detection", - "ASR" = "asr", "Image Classification" = "image_classification", "Image Segmentation" = "image_segmentation") ), @@ -372,7 +289,6 @@ deeplearning_ui = function() { selectInput("history_task_filter", "Filter by Task:", choices = c("All" = "all", "Object Detection" = "object_detection", - "ASR" = "asr", "Image Classification" = "image_classification", "Image Segmentation" = "image_segmentation") ) @@ -408,7 +324,6 @@ deeplearning_ui = function() { h4("Inference", style="margin-top:20px;"), selectInput("inference_task_selector", "Select Inference Task:", choices = c("Object Detection" = "object_detection", - "ASR" = "asr", "Image Classification" = "image_classification", "Image Segmentation" = "image_segmentation") ), @@ -422,11 +337,13 @@ deeplearning_ui = function() { selectInput("infer_checkpoint_dropdown", "Select Checkpoint", choices = NULL), fileInput("infer_obj_image_upload", "Upload Image for Detection", accept = c('image/png', 'image/jpeg', 'image/jpg')), sliderInput("infer_obj_threshold", "Confidence Threshold", min = 0.01, max = 1.0, value = 0.25, step = 0.01), + # IoU / max-detections only apply to the Ultralytics inference path, + # i.e. any yolo* checkpoint except YOLOS (a Transformers model), plus RT-DETR. conditionalPanel( - condition = "input.infer_checkpoint_dropdown && input.infer_checkpoint_dropdown.includes('yolo11')", + condition = "input.infer_checkpoint_dropdown && ((input.infer_checkpoint_dropdown.includes('yolo') && !input.infer_checkpoint_dropdown.includes('yolos')) || input.infer_checkpoint_dropdown.includes('rtdetr'))", numericInput("infer_obj_iou", "IoU Threshold (NMS)", 0.7, min = 0.01, max = 1.0, step = 0.05), numericInput("infer_obj_max_det", "Max Detections", 300, min = 1) - ), + ), actionButton("start_obj_inference", "Run Inference", class = "btn-info", style="margin-top: 10px;") ), @@ -435,23 +352,6 @@ deeplearning_ui = function() { uiOutput("inference_status_ui"), imageOutput("inference_image_output", height = "auto") ), - conditionalPanel( - condition = "input.inference_task_selector == 'asr'", - h4("ASR Inference"), - wellPanel( - textInput("infer_asr_run_name", "Enter Run Name to Find Checkpoints", ""), - selectInput("infer_asr_checkpoint_dropdown", "Select Checkpoint", choices = NULL), - fileInput("infer_asr_audio_upload", "Upload Audio File", accept = c('audio/wav', 'audio/mp3', 'audio/flac')), - actionButton("start_asr_inference", "Run Inference", class = "btn-info", style="margin-top: 10px;") - ), - hr(), - h5("Transcription Result"), - uiOutput("asr_inference_status_ui"), - div( - style = "background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 5px; padding: 15px; margin-top: 5px; min-height: 100px; font-size: 1.1em;", - textOutput("asr_transcription_output") - ) - ), conditionalPanel( condition = "input.inference_task_selector == 'image_classification'", h4("Image Classification Inference"), @@ -492,285 +392,4 @@ deeplearning_ui = function() { ) -# #CNN -# tabItem(tabName = "dashboard", -# fluidRow( -# box( -# title = "API Status", status = "primary", solidHeader = TRUE, width = 6, -# actionButton("check_status", "Check API Status", class = "btn-primary"), -# br(), br(), -# verbatimTextOutput("api_status") -# ), -# box( -# title = "MLflow Server", status = "info", solidHeader = TRUE, width = 6, -# actionButton("start_mlflow", "Start MLflow Server", class = "btn-info"), -# br(), br(), -# verbatimTextOutput("mlflow_output") -# ) -# ), -# fluidRow( -# box( -# title = "All Jobs Overview", status = "success", solidHeader = TRUE, width = 12, -# actionButton("refresh_dashboard_jobs", "Refresh Jobs List", class = "btn-success"), -# br(), br(), -# DT::dataTableOutput("dashboard_jobs_table") -# ) -# ), -# fluidRow( -# box( -# title = "Quick Info", status = "warning", solidHeader = TRUE, width = 12, -# h4("Welcome to the No-Code AI Platform"), -# p("This R Shiny interface provides full functionality for the FastAPI backend."), -# p("Available features:"), -# tags$ul( -# tags$li("Dashboard: Check API status and view all jobs"), -# tags$li("Create Pipeline: Set up new ML training pipelines"), -# tags$li("Train Model: Upload datasets and start training"), -# tags$li("Make Predictions: Use trained models for inference"), -# tags$li("View Jobs: Monitor all training jobs"), -# tags$li("View Datasets: Browse available datasets"), -# tags$li("Delete Job: Remove unwanted jobs") -# ), -# div(class = "success-box", -# strong("Ready: "), -# "Full functionality available with proper HTTP requests using the 'httr' package. ", -# "All features including file uploads, training, and predictions are supported." -# ) -# ) -# ) -# ) -# -# # Create Pipeline Tab -# tabItem(tabName = "create", -# fluidRow( -# box( -# title = "Create New Pipeline", status = "primary", solidHeader = TRUE, width = 12, -# fluidRow( -# column(6, -# textInput("pipeline_name", "Pipeline Name", value = "My Image Classifier"), -# selectInput("task_type", "Task Type", -# choices = list("Image Classification" = "image_classification", -# "Object Detection" = "object_detection"), -# selected = "image_classification"), -# selectInput("architecture", "Model Architecture", -# choices = list("ResNet-18" = "resnet18", -# "ResNet-50" = "resnet50", -# "VGG-16" = "vgg16", -# "MobileNet" = "mobilenet", -# "EfficientNet" = "efficientnet"), -# selected = "resnet18"), -# numericInput("num_classes", "Number of Classes", value = 2, min = 2, max = 1000) -# ), -# column(6, -# numericInput("batch_size", "Batch Size", value = 8, min = 1, max = 128), -# numericInput("epochs", "Epochs", value = 5, min = 1, max = 1000), -# numericInput("learning_rate", "Learning Rate", value = 0.001, min = 0.0001, max = 1, step = 0.0001), -# textInput("image_size", "Image Size (width, height)", value = "224, 224") -# ) -# ), -# fluidRow( -# column(6, -# checkboxInput("augmentation", "Enable Data Augmentation", value = TRUE) -# ), -# column(6, -# checkboxInput("early_stopping", "Enable Early Stopping", value = TRUE) -# ) -# ), -# br(), -# actionButton("create_pipeline", "Create Pipeline", class = "btn-primary btn-lg"), -# br(), br(), -# verbatimTextOutput("create_output") -# ) -# ) -# ) -# -# # Train Model Tab -# tabItem(tabName = "train", -# fluidRow( -# box( -# title = "Current Job Status", status = "info", solidHeader = TRUE, width = 12, -# p("Shows the most recently created job ready for training"), -# actionButton("refresh_current_job", "Refresh Current Job", class = "btn-info"), -# br(), br(), -# verbatimTextOutput("current_job_status") -# ) -# ), -# fluidRow( -# box( -# title = "Upload Dataset to Job", status = "success", solidHeader = TRUE, width = 12, -# div(class = "success-box", -# strong("File Upload Ready: "), -# "Upload dataset files directly to a specific job. Maximum file size: 500MB. ", -# "Select a job first, then upload your dataset ZIP file." -# ), -# fluidRow( -# column(6, -# h4("Job Selection"), -# selectInput("upload_job_dropdown", "Select Job for Dataset Upload", choices = list()), -# actionButton("refresh_upload_jobs", "Refresh Jobs", class = "btn-info"), -# br(), br(), -# checkboxInput("is_coco_format_upload", "COCO Format Dataset (Object Detection)", value = FALSE) -# ), -# column(6, -# h4("File Upload"), -# fileInput("dataset_file", "Choose Dataset ZIP File", -# accept = c(".zip"), -# multiple = FALSE), -# p("Supported formats (Max 500MB):"), -# tags$ul( -# tags$li("ZIP files with image folders"), -# tags$li("For Classification: folders with class subfolders"), -# tags$li("For Object Detection: COCO format structure") -# ) -# ) -# ), -# br(), -# actionButton("upload_dataset", "Upload Dataset to Job", class = "btn-success btn-lg"), -# br(), br(), -# verbatimTextOutput("upload_dataset_output") -# ) -# ), -# fluidRow( -# box( -# title = "Link Dataset to Job", status = "primary", solidHeader = TRUE, width = 12, -# p("Connect a pending job to a dataset (either newly uploaded or existing)"), -# fluidRow( -# column(6, -# selectInput("pending_job_dropdown", "Select Pending Job", choices = list()), -# actionButton("refresh_pending_jobs", "Refresh Pending Jobs", class = "btn-info") -# ), -# column(6, -# selectInput("dataset_dropdown", "Select Dataset", choices = list()), -# actionButton("refresh_datasets_dropdown", "Refresh Datasets", class = "btn-success") -# ) -# ), -# actionButton("link_dataset", "Link Dataset to Job", class = "btn-primary"), -# br(), br(), -# verbatimTextOutput("link_output") -# ) -# ), -# fluidRow( -# box( -# title = "Start Training", status = "warning", solidHeader = TRUE, width = 12, -# p("Start training jobs that have datasets linked"), -# selectInput("trainable_job_dropdown", "Select Job Ready for Training", choices = list()), -# actionButton("refresh_trainable_jobs", "Refresh Trainable Jobs", class = "btn-info"), -# br(), br(), -# actionButton("start_training_btn", "Start Training", class = "btn-warning btn-lg"), -# br(), br(), -# verbatimTextOutput("training_output") -# ) -# ) -# ) -# -# # Make Predictions Tab -# tabItem(tabName = "predict", -# fluidRow( -# box( -# title = "Model Selection", status = "primary", solidHeader = TRUE, width = 12, -# selectInput("predict_job_dropdown", "Select Trained Model", choices = list()), -# actionButton("refresh_prediction_models", "Refresh Available Models", class = "btn-info"), -# br(), br(), -# verbatimTextOutput("prediction_models_status") -# ) -# ), -# fluidRow( -# box( -# title = "Image Upload & Prediction", status = "success", solidHeader = TRUE, width = 12, -# fluidRow( -# column(6, -# h4("Upload Image"), -# fileInput("prediction_image", "Choose Image File", -# accept = c(".jpg", ".jpeg", ".png", ".bmp", ".tiff"), -# multiple = FALSE), -# p("Supported formats: JPG, PNG, BMP, TIFF") -# ), -# column(6, -# h4("Prediction Settings"), -# sliderInput("confidence_threshold", -# "Confidence Threshold", -# value = 0.5, min = 0.1, max = 0.95, step = 0.05, -# post = "%"), -# p(class = "help-text", style = "font-size: 12px; color: #666;", -# "Higher values show fewer, more confident detections. Lower values show more detections but may include false positives."), -# checkboxInput("show_probabilities", "Show All Class Probabilities", value = TRUE) -# ) -# ), -# br(), -# actionButton("make_prediction", "Make Prediction", class = "btn-primary btn-lg"), -# br(), br(), -# fluidRow( -# column(6, -# h4("Prediction Results"), -# verbatimTextOutput("prediction_output") -# ), -# column(6, -# h4("Uploaded Image"), -# imageOutput("prediction_image_display", height = "400px"), -# br(), -# textOutput("image_info") -# ) -# ) -# ) -# ) -# ) -# -# # Jobs Tab -# tabItem(tabName = "jobs", -# fluidRow( -# box( -# title = "All Jobs", status = "info", solidHeader = TRUE, width = 12, -# actionButton("refresh_jobs", "Refresh Jobs List", class = "btn-info"), -# br(), br(), -# DT::dataTableOutput("jobs_table") -# ) -# ), -# fluidRow( -# box( -# title = "Job Details", status = "success", solidHeader = TRUE, width = 12, -# textInput("job_status_id", "Job ID", placeholder = "Enter Job ID to view details"), -# actionButton("get_job_details", "Get Job Status", class = "btn-success"), -# br(), br(), -# verbatimTextOutput("job_details_output") -# ) -# ) -# ) -# -# # Datasets Tab -# tabItem(tabName = "datasets", -# fluidRow( -# box( -# title = "Available Datasets", status = "success", solidHeader = TRUE, width = 12, -# actionButton("refresh_datasets", "Refresh Datasets", class = "btn-success"), -# br(), br(), -# DT::dataTableOutput("datasets_table") -# ) -# ) -# ) -# -# # Delete Job Tab -# tabItem(tabName = "delete", -# fluidRow( -# box( -# title = "Delete Job", status = "danger", solidHeader = TRUE, width = 12, -# div(class = "warning-box", -# strong("Warning: "), -# "Deleting a job will permanently remove all associated data including trained models, datasets, and logs. This action cannot be undone." -# ), -# selectInput("delete_job_dropdown", "Select Job to Delete", choices = list()), -# actionButton("refresh_delete_jobs", "Refresh Jobs List", class = "btn-info"), -# br(), br(), -# actionButton("delete_job_btn", "Delete Selected Job", class = "btn-danger btn-lg"), -# br(), br(), -# verbatimTextOutput("delete_output") -# ) -# ) -# ) -# - - - - - - }