#Conv-Lora git repo: 
	- https://github.com/autogluon/autogluon/tree/master/examples/automm/Conv-LoRA
#Copy directory and files: 
	` https://github.com/autogluon/autogluon/tree/master/examples/automm/Conv-LoRA `
 - copy all files in code/ to autogluon/examples/automm/Conv-LoRA/


#Dataset Size:
	- Tr1: 5724
	- Tr2: 1142
	- Te-1: 920
	- Te-2: 920
	- Te-3: 5000
	- Te-4: 1080
	- Te-5: 600
	- Te-6: 785

#Run code:
# cd autogluon/examples/automm/Conv-LoRA/
## Train each class (1, 2, 3)
	```
	python run_semantic_segmentation.py --task gan-generated --dataset_dir /mnt/DGX01/anika/datasets --output_dir /mnt/DGX01/anika/datasets/gan-generated/output_defect_class1 --ckpt_path AutogluonModels/gan-ckpts --data_name defect_class1 --num_gpus 2 --batch_size 4 --rank 2
	```

	##args:
		- task : gan-generated
		- dataset_dir: main directory of dataset
		- output_dir: output directory
		- ckpt_path: where to save model
		- data_name: options: defect_class1, defect_class2
		- num_gpus
		- batch_size
		- rank

## Test class 1 each file (3)
	```
	python run_semantic_segmentation.py --task gan-generated --dataset_dir /mnt/DGX01/anika/datasets --output_dir /mnt/DGX01/anika/datasets/gan-generated/output_defects/defect_class1/test1 --ckpt_path AutogluonModels/ag-20240826_214753 --data_name defect_class1 --num_gpus 3 --batch_size 4 --rank 2 --eval
	```
## Test class 2 each file (4)
	```
	python run_semantic_segmentation.py --task gan-generated --dataset_dir /mnt/DGX01/anika/datasets --output_dir /mnt/DGX01/anika/datasets/gan-generated/output_defects/defect_class2/test1 --ckpt_path AutogluonModels/ag-20240828_143435/epoch=13-step=24038.ckpt --data_name defect_class2 --num_gpus 4 --batch_size 4 --rank 2 --eval
	```

	##args:
		-ckpt_path : we need to use the ckpt what will be in /mnt/DGX01/anika/sam-finetune/autogluon/examples/automm/Conv-LoRA/AutogluonModels/
## Test class 3 
```
python run_semantic_segmentation.py --task gan-generated --dataset_dir /mnt/DGX01/anika/datasets --output_dir /mnt/DGX01/anika/datasets/gan-generated/output-defects/defect_class3/test1 --ckpt_path AutogluonModels/ag-20240905_025905 --data_name defect_class3 --num_gpus 4 --batch_size 4 --rank 2 --eval
```

## Get Prediction images and calculate score for each class
 ```
 python calc_result.py
 ```
 -- fix prediction model name
 -- output name

## Get Multiclass Prediction 
```
python plot_multiclass_pred --test_id 1 --hist_match
```
	-- test_id: change the test value
	-- hist_match: only keep is using histogram matching input

## Appendix:
- env: /mnt/DGX01/anika/conv-lora
- datasets: /mnt/DGX01/anika/datasets/gan-generated/defects
- data files: 
	1. /mnt/DGX01/anika/datasets/gan-generated/train_defect_class1.csv
	2. /mnt/DGX01/anika/datasets/gan-generated/train_defect_class2.csv
	3. /mnt/DGX01/anika/datasets/gan-generated/test_defect_class1.csv
	4. /mnt/DGX01/anika/datasets/gan-generated/test_defect_class2.csv

