How ahwar/hyperspect works
This repository implements S2ADet, a hyperspectral object-detection workflow, alongside YOLOv5 and RF-DETR training and inference paths. The documented main path prepares spectral/spatial information, trains a two-stream detector, evaluates it, and runs detection or generates submissions. The README establishes HID and the detector stages; sampled source supports dataset loading, YOLO model construction, and RF-DETR stream handling. Some subsystem connections are omitted where implementation details were not sampled.
Main entry points: train.py YOLO training · hsi Prepared streams · detect_twostream.py Two-stream inference · yolo.py Detector model
Components 19
HSI preparation
- Spectral-spatial prep
convert_dataset.py - Cube conversion
x2cube.py - Prepared streams
data/hsi
S2ADet / YOLO
- YOLO training
train.py - Data loading
utils/datasets.py - Fusion configs
models/hsi - Detector model
models/yolo.py - Model layers
models/common.py - Detection loss
utils/loss.py
RF-DETR path
- RF-DETR training
train_rfdetr.py - RF-DETR conversion
convert_dataset_rfdetr.py
Evaluation and output
- Validation metrics
test.py - Metric calculations
utils/metrics.py - Two-stream inference
detect_twostream.py - YOLO submission
generate_submission_yolo.py - RF-DETR submission
generate_submission_rfdetr.py
Other components
- Researcher
- HSI datasets
data/hsi - Detections and scores
Connections 26
- Researcher → Spectral-spatial prep: prepare data
- HSI datasets → Spectral-spatial prep: processes
- Spectral-spatial prep → Prepared streams: produces streams
- HSI datasets → Cube conversion: cube input
- Cube conversion → Prepared streams: produces cubes
- Researcher → YOLO training: trains detector
- Prepared streams → Data loading: loads streams
- YOLO training → Data loading: uses batches
- YOLO training → Detector model: optimizes
- Fusion configs → Detector model: configures
- Detector model → Model layers: uses layers
- YOLO training → Detection loss: computes loss
- YOLO training → Validation metrics: validates
- Validation metrics → Metric calculations: computes metrics
- Researcher → Two-stream inference: runs inference
- Two-stream inference → Detector model: predicts with
- Two-stream inference → Detections and scores: writes detections
- Validation metrics → Detections and scores: reports scores
- Researcher → RF-DETR conversion: converts data
- RF-DETR conversion → Prepared streams: produces inputs
- Researcher → RF-DETR training: trains alternate
- Prepared streams → RF-DETR training: provides streams
- RF-DETR training → RF-DETR submission: supplies weights
- Two-stream inference → YOLO submission: supports output
- YOLO submission → Detections and scores: writes detections
- RF-DETR submission → Detections and scores: writes detections