Add raster tile segmentation handoff
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-06-24 06:14:21 +02:00
parent fcd7d6ebee
commit 140314a81d
9 changed files with 107 additions and 1 deletions
+14
View File
@@ -271,6 +271,7 @@ function App(): JSX.Element {
selectedSegmentationDatasetId,
selectedSegmentationModelId,
selectedSegmentationModel,
segmentationTileManifestPath,
segmentationConfidenceThreshold,
runningSegmentation,
segmentationRunResult,
@@ -294,6 +295,7 @@ function App(): JSX.Element {
resetSegmentationForProject,
setSelectedSegmentationDatasetId,
setSelectedSegmentationModelId,
setSegmentationTileManifestPath,
setSegmentationConfidenceThreshold,
setSelectedSegmentationRunId,
setSegmentationClassFilter,
@@ -306,6 +308,15 @@ function App(): JSX.Element {
loadProjectData,
loadQualityChecks,
})
const useRasterTileManifestForSegmentation = () => {
const manifestPath = latestRasterTileManifestPath.trim()
if (!manifestPath || !selectedDataset || selectedDataset.dataset_type !== 'raster') {
return
}
setSegmentationTileManifestPath(manifestPath)
setSelectedSegmentationDatasetId(selectedDataset.id)
setActiveWorkspace('ai')
}
const {
exports,
latestExport,
@@ -859,6 +870,7 @@ function App(): JSX.Element {
segmentationModelError={segmentationModelError}
selectedSegmentationDatasetId={selectedSegmentationDatasetId}
selectedSegmentationModelId={selectedSegmentationModelId}
segmentationTileManifestPath={segmentationTileManifestPath}
segmentationConfidenceThreshold={segmentationConfidenceThreshold}
runningSegmentation={runningSegmentation}
segmentationRunResult={segmentationRunResult}
@@ -881,6 +893,7 @@ function App(): JSX.Element {
onLoadModels={loadSegmentationModels}
onSelectDataset={setSelectedSegmentationDatasetId}
onSelectModel={setSelectedSegmentationModelId}
onSetTileManifestPath={setSegmentationTileManifestPath}
onSetConfidenceThreshold={setSegmentationConfidenceThreshold}
onRunSegmentation={runSegmentation}
onLoadRuns={() => loadSegmentationRuns()}
@@ -999,6 +1012,7 @@ function App(): JSX.Element {
onRunRasterClip: runRasterClip,
onRunRasterTile: runRasterTile,
onUseTileManifestForDetection: useRasterTileManifestForDetection,
onUseTileManifestForSegmentation: useRasterTileManifestForSegmentation,
onRunRasterNdvi: runRasterNdvi,
onRunRasterNdwi: runRasterNdwi,
onRunRasterNdbi: runRasterNdbi,
@@ -59,6 +59,7 @@ export interface DatasetDetailPanelProps {
onRunRasterClip: () => void
onRunRasterTile: () => void
onUseTileManifestForDetection: () => void
onUseTileManifestForSegmentation: () => void
onRunRasterNdvi: () => void
onRunRasterNdwi: () => void
onRunRasterNdbi: () => void
@@ -142,6 +143,7 @@ export function DatasetDetailPanel({
onRunRasterClip,
onRunRasterTile,
onUseTileManifestForDetection,
onUseTileManifestForSegmentation,
onRunRasterNdvi,
onRunRasterNdwi,
onRunRasterNdbi,
@@ -209,6 +211,7 @@ export function DatasetDetailPanel({
onRunRasterClip={onRunRasterClip}
onRunRasterTile={onRunRasterTile}
onUseTileManifestForDetection={onUseTileManifestForDetection}
onUseTileManifestForSegmentation={onUseTileManifestForSegmentation}
onRunRasterNdvi={onRunRasterNdvi}
onRunRasterNdwi={onRunRasterNdwi}
onRunRasterNdbi={onRunRasterNdbi}
@@ -40,6 +40,7 @@ interface RasterControlsProps {
onRunRasterClip: () => void
onRunRasterTile: () => void
onUseTileManifestForDetection: () => void
onUseTileManifestForSegmentation: () => void
onRunRasterNdvi: () => void
onRunRasterNdwi: () => void
onRunRasterNdbi: () => void
@@ -93,6 +94,7 @@ export function RasterControls({
onRunRasterClip,
onRunRasterTile,
onUseTileManifestForDetection,
onUseTileManifestForSegmentation,
onRunRasterNdvi,
onRunRasterNdwi,
onRunRasterNdbi,
@@ -168,6 +170,9 @@ export function RasterControls({
<button type="button" onClick={onUseTileManifestForDetection} disabled={!latestRasterTileManifestPath}>
Use in Detection Lab
</button>
<button type="button" onClick={onUseTileManifestForSegmentation} disabled={!latestRasterTileManifestPath}>
Use in Segmentation Lab
</button>
</div>
</section>
<section className="raster-guardrail-surface" aria-label="Processing guardrails">
@@ -13,6 +13,7 @@ interface SegmentationLabProps {
segmentationModelError: string | null
selectedSegmentationDatasetId: string
selectedSegmentationModelId: string
segmentationTileManifestPath: string
segmentationConfidenceThreshold: number
runningSegmentation: boolean
segmentationRunResult: SegmentationRunResponse | null
@@ -35,6 +36,7 @@ interface SegmentationLabProps {
onLoadModels: () => void
onSelectDataset: (datasetId: string) => void
onSelectModel: (modelId: string) => void
onSetTileManifestPath: (value: string) => void
onSetConfidenceThreshold: (value: number) => void
onRunSegmentation: () => void
onLoadRuns: () => void
@@ -52,6 +54,7 @@ export function SegmentationLab({
segmentationModelError,
selectedSegmentationDatasetId,
selectedSegmentationModelId,
segmentationTileManifestPath,
segmentationConfidenceThreshold,
runningSegmentation,
segmentationRunResult,
@@ -74,6 +77,7 @@ export function SegmentationLab({
onLoadModels,
onSelectDataset,
onSelectModel,
onSetTileManifestPath,
onSetConfidenceThreshold,
onRunSegmentation,
onLoadRuns,
@@ -183,6 +187,15 @@ export function SegmentationLab({
/>
</label>
</div>
<label>
Tile manifest
<input
type="text"
placeholder="Raster tile manifest path"
value={segmentationTileManifestPath}
onChange={(event) => onSetTileManifestPath(event.target.value)}
/>
</label>
<button
className="primary-action"
type="button"
@@ -31,6 +31,7 @@ export function useSegmentationWorkflow({
const [segmentationModelError, setSegmentationModelError] = useState<string | null>(null)
const [selectedSegmentationDatasetId, setSelectedSegmentationDatasetId] = useState('')
const [selectedSegmentationModelId, setSelectedSegmentationModelId] = useState('segmentation-placeholder')
const [segmentationTileManifestPath, setSegmentationTileManifestPath] = useState('')
const [segmentationConfidenceThreshold, setSegmentationConfidenceThreshold] = useState(0.5)
const [runningSegmentation, setRunningSegmentation] = useState(false)
const [segmentationRunResult, setSegmentationRunResult] = useState<SegmentationRunResponse | null>(null)
@@ -137,6 +138,7 @@ export function useSegmentationWorkflow({
dataset_id: datasetId,
model_id: selectedSegmentationModelId,
confidence_threshold: segmentationConfidenceThreshold,
tile_manifest_path: segmentationTileManifestPath.trim() || null,
parameters_json: parameters,
})
setSegmentationRunResult(result)
@@ -186,6 +188,7 @@ export function useSegmentationWorkflow({
setSegmentationItems([])
setSegmentationGeoJson(null)
setSegmentationRunResult(null)
setSegmentationTileManifestPath('')
}
return {
@@ -195,6 +198,7 @@ export function useSegmentationWorkflow({
selectedSegmentationDatasetId,
selectedSegmentationModelId,
selectedSegmentationModel,
segmentationTileManifestPath,
segmentationConfidenceThreshold,
runningSegmentation,
segmentationRunResult,
@@ -218,6 +222,7 @@ export function useSegmentationWorkflow({
resetSegmentationForProject,
setSelectedSegmentationDatasetId,
setSelectedSegmentationModelId,
setSegmentationTileManifestPath,
setSegmentationConfidenceThreshold,
setSelectedSegmentationRunId,
setSegmentationClassFilter,