From abae2d5a8be2dcc949285abf6c04e9caa984a815 Mon Sep 17 00:00:00 2001 From: sumona-banerjeee Date: Mon, 2 Mar 2026 12:51:48 +0530 Subject: [PATCH] feat: add Select Method field with dummy data options - Added Select Method dropdown (YOLO, YOLO with VL, SAM 3) - Updated detection row to a responsive 3-column layout - Included select_method in upload API payload --- app/upload/page.tsx | 38 +++++++++++++++++++++++++++--- components/upload-section.tsx | 44 ++++++++++++++++++++++++++++++++--- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/app/upload/page.tsx b/app/upload/page.tsx index fadb85d..5d19ad3 100644 --- a/app/upload/page.tsx +++ b/app/upload/page.tsx @@ -35,6 +35,7 @@ export default function UploadPage() { const [jsonFile, setJsonFile] = useState(null) const [speed, setSpeed] = useState(30) const [detectionType, setDetectionType] = useState("pothole-detection") + const [selectMethod, setSelectMethod] = useState("yolo") // Upload states const [uploading, setUploading] = useState(false) @@ -108,6 +109,7 @@ export default function UploadPage() { formData.append("file", file) formData.append("detection_type", detectionType) formData.append("speed_kmh", speed.toString()) + formData.append("select_method", selectMethod) if (jsonFile) { formData.append("json_file", jsonFile) } @@ -236,11 +238,11 @@ export default function UploadPage() { - Select video file, detection type, and vehicle speed for analysis + Select video file, detection type, vehicle speed, and method for analysis -
+
{/* Video File Input */}
+ {/* Detection, Speed, and Method Row */} +
{/* Detection Type */}
+ + {/* Select Method */} +
+ + +
{/* Error Display */} diff --git a/components/upload-section.tsx b/components/upload-section.tsx index 07d5fa8..9bc8adf 100644 --- a/components/upload-section.tsx +++ b/components/upload-section.tsx @@ -24,6 +24,7 @@ export function UploadSection({ onDetectionComplete, onDetectionTypeChange }: Up const [jsonFile, setJsonFile] = useState(null) const [speed, setSpeed] = useState(30) const [detectionType, setDetectionType] = useState("pothole-detection") + const [selectMethod, setSelectMethod] = useState("yolo") const [uploading, setUploading] = useState(false) const [progress, setProgress] = useState(0) const [statusMessage, setStatusMessage] = useState("") @@ -135,6 +136,7 @@ export function UploadSection({ onDetectionComplete, onDetectionTypeChange }: Up formData.append("file", file) formData.append("detection_type", detectionType) formData.append("speed_kmh", speed.toString()) + formData.append("select_method", selectMethod) // Add JSON file if provided if (jsonFile) { @@ -202,11 +204,12 @@ export function UploadSection({ onDetectionComplete, onDetectionTypeChange }: Up Upload Video - Select a video file, detection type, and vehicle speed to start AI-powered analysis + Select video file, detection type, vehicle speed, and method for analysis -
+
+ {/* Video File Input kept in 2-col row */} {/* File Input */}
@@ -255,6 +258,10 @@ export function UploadSection({ onDetectionComplete, onDetectionTypeChange }: Up )}
+
+ + {/* Detection Type, Speed, and Method - 3 column row */} +
{/* Detection Type Selector */}
@@ -288,7 +295,7 @@ export function UploadSection({ onDetectionComplete, onDetectionTypeChange }: Up {/* Speed Input */}
- +
+ + {/* Select Method */} +
+ + +
{/* Error Display */}