Ruikai He, Minchen Wei
ALS information: low-resolution multispectral data of scene illuminant
-
./LinearTransformation/mainFunc_Demo.ipynbshows the framework of illuminant estimation by Linear Transformation including data split and$M$ matrix solution -
./necessarityFunc.pyincludes two core functions including Gap-Statstic for hyperparametern_clusterand choose training data byK-Means. - The demo dataset is Normal Dataset:
data_ALSs_NormalDataset.npyanddata_WPs_NormalDataset.npystores ALS information and RGB illuminant color of corresponding scene.
-
tested on Linux and
pytorch==2.4.1 -
model training follows the code cell:
cd ./C5_13Spectral python train.py --use-spectral 1 --learn-G True --training-dir-in ./dataset/Dataset_Normal -
test the trained model follows the code cell:
cd ./C5_13Spectral python test.py --use-spectral 1 --use-spectral-input 0 --testing-dir-in ./dataset/Dataset_Normal --g-multiplier True -
--use-spectralcontrols input choices--use-spectral 1means using both ALS information and RGB images (DUAL input chocies)--use-spectral 0means using only RGB images (ORGB input chocies)
-
--use-spectral-inputcontrols input choices, only valid for model testing--use-spectral-input 0follows the configuration of--use-spectral--use-spectral-input 1means test using only ALS information (OALS input choices)--use-spectral-input 2means test using only RGB images (ORGB)
-
the demo dataset is
Normal Dataset:./dataset/Dataset_Normal/numpy_data/*.npzsaves the RAW-RGB image and corresponding ALS information, and./dataset/Dataset_Normal/numpy_labels/*.npysaves the RGB illuminant color of scene. -
acknowledge the public availibility of the initial C5 model, the project
C5_13Spectralis built upon the initial C5 model.
-
the configuration and platform are the same as the point #1 in fine-tuned C5 with different input choices
-
model training follows the code cell:
cd ./PCC_13Spectral python script_train.py -
following the previous point (#2),
-modecontrols training input choices-mode semantic_spectralmeans input choice DUAL / using both ALS information and RGB images-mode spectralmeans input choice OALS / using only ALS information-mode semanticmeans input choice ORGB / using only RGB images
-
Before test your model, please make you can rename the model folder,
fold_0,fold_1, andfold_2 -
model testing follows the next code cell example:
cd ./PCC_13Spectral python test.py -input_mode 0 -data_path ./dataset/Dataset_Normal -mode spectral -
follwing the previous point (#5),
-input_modeexclusive to testing model, control testing input choices-input_mode 0means the same as-modeinput choice-input_mode 1means input choice OALS / using only ALS information-input_mode 2means input choice ORGB / using only RGB images
-
the demo dataset is the same as that in fine-tuned C5 with different input choices, check the details in Point #6 in the corresponding section.
-
acknowledge the public availability of the initial PCC model. This part is built upon the initial PCC model.
-
the configuration and platform are the same as the point #1 in fine-tuned C5 with different input choices and fine-tuned PCC with different input choice
-
the demo dataset is the same as that in fine-tuned C5 with different input choices, check the details in Point #6 in the corresponding section.
-
model training follows the code cell:
cd ./ucc_13Spectral python script_train.py -
following the previous point (#3),
--use_speccontrols the input choices during model training--use_spec 1means input choice DUAL / using both ALS information and RGB images--use_spec 0means input choice ORGB / using only RGB images
-
model testing following the code cell:
cd ./ucc_13Spectral python test.py --use_spec 1 --input_mode 0 --data_dir ./dataset/Dataset_Normal -
following the previous point (#5),
--input_modecontrols the input choices during model testing--input_mode 0means follows the input choice during model training--input_mode 1means input choice OALS / tested using only ALS information--input_mode 2means input choice ORGB / tested using only RGB images

