forked from eric612/MobileNet-YOLO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
3,743 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cur_dir=$(cd $( dirname ${BASH_SOURCE[0]} ) && pwd ) | ||
root_dir=$cur_dir/../.. | ||
|
||
cd $root_dir | ||
|
||
redo=1 | ||
data_root_dir="/media/data/" | ||
dataset_name="tusimple" | ||
#mapfile="$root_dir/data/$dataset_name/labelmap.prototxt" | ||
anno_type="lane_detection" | ||
db="lmdb" | ||
min_dim=0 | ||
max_dim=0 | ||
width=0 | ||
height=0 | ||
label_type="json" | ||
extra_cmd="--encode-type=jpg --encoded" | ||
if [ $redo ] | ||
then | ||
extra_cmd="$extra_cmd --redo" | ||
fi | ||
for subset in train | ||
do | ||
python $root_dir/scripts/create_annoset.py --anno-type=$anno_type \ | ||
--min-dim=$min_dim --max-dim=$max_dim --resize-width=$width --label-type=$label_type \ | ||
--resize-height=$height --check-label $extra_cmd $data_root_dir $root_dir/data/$dataset_name/$subset.txt \ | ||
$data_root_dir/$dataset_name/$db/$dataset_name"_"$subset"_"$db examples/$dataset_name | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cur_dir=$(cd $( dirname ${BASH_SOURCE[0]} ) && pwd ) | ||
root_dir=$cur_dir/../.. | ||
|
||
cd $root_dir | ||
|
||
redo=1 | ||
data_root_dir="$HOME/" | ||
dataset_name="fisheye" | ||
mapfile="$root_dir/data/$dataset_name/labelmap_fisheye.prototxt" | ||
anno_type="detection" | ||
db="lmdb" | ||
min_dim=0 | ||
max_dim=0 | ||
width=0 | ||
height=0 | ||
|
||
extra_cmd="--encode-type=jpg --encoded" | ||
if [ $redo ] | ||
then | ||
extra_cmd="$extra_cmd --redo" | ||
fi | ||
for subset in test test_time_Afternoon test_time_Day test_time_Night test_weather_Cloudy test_weather_Normal test_weather_Rain trainval | ||
do | ||
python $root_dir/scripts/create_annoset.py --anno-type=$anno_type \ | ||
--label-map-file=$mapfile --min-dim=$min_dim --max-dim=$max_dim --resize-width=$width \ | ||
--resize-height=$height --check-label $extra_cmd $data_root_dir $root_dir/data/$dataset_name/$subset.txt \ | ||
$data_root_dir/$dataset_name/$db/$dataset_name"_"$subset"_"$db examples/$dataset_name | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
root_dir=/media/data/ | ||
#root_dir="../../data/VOCdevkit" | ||
sub_dir=ImageSets/Main | ||
bash_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
for dataset in train | ||
do | ||
dst_file=$bash_dir/$dataset.txt | ||
if [ -f $dst_file ] | ||
then | ||
rm -f $dst_file | ||
fi | ||
for name in tusimple #VOC2007 VOC2012 | ||
do | ||
if [[ $dataset == "test" && $name == "VOC2012" ]] | ||
then | ||
continue | ||
fi | ||
echo "Create list for $name $dataset..." | ||
dataset_file=$root_dir/$name/$sub_dir/$dataset.txt | ||
|
||
img_file=$bash_dir/$dataset"_img.txt" | ||
cp $dataset_file $img_file | ||
sed -i "s/^/$name\/JPEGImages\//g" $img_file | ||
sed -i "s/$/.jpg/g" $img_file | ||
|
||
label_file=$bash_dir/$dataset"_label.txt" | ||
cp $dataset_file $label_file | ||
sed -i "s/^/$name\/Annotations\//g" $label_file | ||
sed -i "s/$/.json/g" $label_file | ||
|
||
paste -d' ' $img_file $label_file $label_file2>> $dst_file | ||
|
||
rm -f $label_file | ||
rm -f $img_file | ||
done | ||
# Shuffle trainval file. | ||
if [ $dataset == "train" ] | ||
then | ||
rand_file=$dst_file.random | ||
cat $dst_file | perl -MList::Util=shuffle -e 'print shuffle(<STDIN>);' > $rand_file | ||
mv $rand_file $dst_file | ||
fi | ||
done |
Oops, something went wrong.