chore: culvert addition
This commit is contained in:
@@ -12,6 +12,7 @@ import { SessionContext, DetectionData, DetectionType } from '@/types';
|
||||
import { getVideoFile, clearVideoFile } from '@/lib/video-storage';
|
||||
import { ROUTES } from '@/utils/routes';
|
||||
import { Card } from '@/components/ui/card';
|
||||
import { getDetectionModeConfig } from '@/constants/detectionModeConfig';
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
@@ -36,7 +37,12 @@ export default function VideoResultsPage() {
|
||||
setDetectionData(data as any);
|
||||
|
||||
// Try to infer detection type from results if possible
|
||||
if (data.summary?.unique_signboards !== undefined && data.summary?.unique_signboards > 0) {
|
||||
if (data.detection_mode) {
|
||||
setDetectionType(data.detection_mode);
|
||||
} else if (
|
||||
data.summary?.unique_signboards !== undefined &&
|
||||
data.summary?.unique_signboards > 0
|
||||
) {
|
||||
setDetectionType('sign-board-detection');
|
||||
} else if (
|
||||
data.summary?.unique_potholes !== undefined &&
|
||||
@@ -75,9 +81,8 @@ export default function VideoResultsPage() {
|
||||
};
|
||||
|
||||
const getTitle = () => {
|
||||
if (detectionType === 'pothole-detection') return 'Pothole Detection Results';
|
||||
if (detectionType === 'sign-board-detection') return 'Signboard Detection Results';
|
||||
return 'Pothole & Signboard Detection Results';
|
||||
const config = getDetectionModeConfig(detectionType);
|
||||
return `${config.label} Results`;
|
||||
};
|
||||
|
||||
if (isLoading) {
|
||||
|
||||
@@ -35,10 +35,10 @@ export default function VideoProcessingPage() {
|
||||
if (data.type === 'progress' || data.progress !== undefined) {
|
||||
setProgress(data.progress || 0);
|
||||
let message = data.message || 'Processing...';
|
||||
if (data.unique_potholes !== undefined) {
|
||||
message += ` | Unique: ${data.unique_potholes} | Total: ${data.total_detections || 0}`;
|
||||
} else if (data.unique_signboards !== undefined) {
|
||||
message += ` | Unique: ${data.unique_signboards} | Total: ${data.total_detections || 0}`;
|
||||
const uniqueCount =
|
||||
data.unique_potholes ?? data.unique_signboards ?? data.unique_culverts;
|
||||
if (uniqueCount !== undefined) {
|
||||
message += ` | Unique: ${uniqueCount} | Total: ${data.total_detections || 0}`;
|
||||
}
|
||||
setStatusMessage(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user