Skip to content
Snippets Groups Projects
Commit 82a595a1 authored by Spencer Delcore's avatar Spencer Delcore
Browse files

added scripts for running and updated paths to be better, some paths are still hard coded

parent 5b829a6d
No related branches found
No related tags found
No related merge requests found
# LOST
# ECE613 README
Convert KITTI Labels to COCO version
```
cd tools/Kitti2Coco
python kitti2coco-label-trans.py train $KITTI_ROOT
python kitti2coco-label-trans.py val $KITTI_ROOT
cd -
pip install -r requirements.txt
git clone https://github.com/facebookresearch/dino.git
cd dino;
touch __init__.py
echo -e "import sys\nfrom os.path import dirname, join\nsys.path.insert(0, join(dirname(__file__), '.'))" >> __init__.py;
cd -
```
# Original README
Pytorch implementation of the unsupervised object discovery method **LOST**. More details can be found in the paper:
**Localizing Objects with Self-Supervised Transformers and no Labels**, BMVC 2021 [[arXiv](https://arxiv.org/abs/2109.14279)]
......
......@@ -128,7 +128,7 @@ if __name__ == "__main__":
if args.image_path is not None:
dataset = ImageDataset(args.image_path)
elif args.dataset == "KITTI":
dataset = ImageFolderDataset("/root/kitti/training/image_2/")
dataset = ImageFolderDataset("/root/kitti/training/image_2/") # TODO dont hard code
else:
dataset = Dataset(args.dataset, args.set, args.no_hard)
......@@ -337,8 +337,6 @@ if __name__ == "__main__":
continue
# Compare prediction to GT boxes
ious = []
ious = bbox_iou(torch.from_numpy(pred), torch.from_numpy(np.asarray(gt_bbxs)))
if torch.any(ious >= 0.50):
......@@ -348,7 +346,6 @@ if __name__ == "__main__":
if i >= 0.50:
corloc[im_id] += 1
cnt += len(inp[2])
if cnt % 50 == 0:
......
File mode changed from 100644 to 100755
......@@ -4,27 +4,24 @@ declare -a images=(
#"000028" "000048" "000066" "004459" "000435" "003333" "000291"
"000003"
)
DATASET_PATH=/root/kitti/training/image_2/
DINO_PATH=/root/lost/dino
DATASET_PATH=$KITTI_ROOT/training/image_2/
LOST_PATH=~/lost
DINO_PATH=$LOST_PATH/dino
OUTPUT_PATH=$LOST_PATH/outputs/samples
DINO_ARCH=vit_base
LOST_FEATURES=k
K_PATCHES=10
PATCH_SIZE=16
OUTPUT_PATH=/root/lost/outputs/samples
rm -rf $OUTPUT_PATH
for i in "${images[@]}"
do
echo evaluating $i
#mkdir -p $OUTPUT_PATH/$i/dino
mkdir -p $OUTPUT_PATH/$i/lost
#mkdir -p $OUTPUT_PATH/$i/lost-dinoseg
#mkdir -p $OUTPUT_PATH/$i/images
cd /root/lost/
cd $LOST_PATH
python main_lost.py \
--image_path $DATASET_PATH/$i.png \
......@@ -53,5 +50,4 @@ do
--visualize seed_expansion \
--num_init_seeds 1
echo
done
\ No newline at end of file
......@@ -5,4 +5,6 @@ taken from https://github.com/packyan/Kitti2Coco
modifications done by Spencer Delcore
## this this a tool to tranfrom these two datasets labels.
use`kitti2coco-label-trans.py' to tansfrom labels.
```
python kitti2coco-label-trans.py train $PATH_TO_KITTI
```
......@@ -18,9 +18,13 @@ valid_labels = [
'Tram',
'Misc'
]
KITTI_FOLDER_PATH = sys.argv[2]
KITTI_FILE_NAME = sys.argv[1]
#data_set path
kitti_img_path = '/root/kitti/training/image_2/'
kitti_label_path = '/root/kitti/training/label_2/'
kitti_img_path = KITTI_FOLDER_PATH + '/training/image_2/'
kitti_label_path = KITTI_FOLDER_PATH + '/training/label_2/'
#transformed lables path
kitti_label_tosave_path = 'labels2coco/'
......@@ -34,8 +38,6 @@ kitti_data_real_path = kitti_img_path
index = 0
cvfont = cv2.FONT_HERSHEY_SIMPLEX
KITTI_FILE_NAME = sys.argv[1]
if KITTI_FILE_NAME != 'train' or KITTI_FILE_NAME != 'val':
exit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment