Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
yangxue0827 committed Dec 8, 2017
1 parent 0858c8b commit c847b1a
Show file tree
Hide file tree
Showing 17 changed files with 55 additions and 57 deletions.
2 changes: 1 addition & 1 deletion data/io/convert_data_to_tfrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import tensorflow as tf
import glob
import cv2
from libs.label_name_dict.remote_sensing_dict import *
from libs.label_name_dict.label_dict import *
from help_utils.tools import *

tf.app.flags.DEFINE_string('VOC_dir', None, 'Voc dir')
Expand Down
Binary file modified help_utils/__pycache__/help_utils.cpython-35.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion help_utils/help_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import tensorflow as tf
import numpy as np
import cv2
from libs.label_name_dict.remote_sensing_dict import LABEl_NAME_MAP
from libs.label_name_dict.label_dict import LABEl_NAME_MAP


def show_boxes_in_img(img, boxes_and_label):
Expand Down
2 changes: 1 addition & 1 deletion libs/box_utils/show_box_in_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tensorflow as tf
import numpy as np
import cv2
from libs.label_name_dict.remote_sensing_dict import LABEl_NAME_MAP
from libs.label_name_dict.label_dict import LABEl_NAME_MAP


def draw_box_in_img_batch(img_batch, boxes):
Expand Down
Binary file not shown.
50 changes: 50 additions & 0 deletions libs/label_name_dict/label_dict.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import

from libs.configs import cfgs

if cfgs.DATASET_NAME == 'ship':
NAME_LABEL_MAP = {
'back_ground': 0,
'ship': 1
}
elif cfgs.DATASET_NAME == 'aeroplane':
NAME_LABEL_MAP = {
'back_ground': 0,
'aeroplane': 1
}
elif cfgs.DATASET_NAME == 'pascal':
NAME_LABEL_MAP = {
'back_ground': 0,
'aeroplane': 1,
'bicycle': 2,
'bird': 3,
'boat': 4,
'bottle': 5,
'bus': 6,
'car': 7,
'cat': 8,
'chair': 9,
'cow': 10,
'diningtable': 11,
'dog': 12,
'horse': 13,
'motorbike': 14,
'person': 15,
'pottedplant': 16,
'sheep': 17,
'sofa': 18,
'train': 19,
'tvmonitor': 20
}
else:
assert 'please set label dict!'


def get_label_name_map():
reverse_dict = {}
for name, label in NAME_LABEL_MAP.items():
reverse_dict[label] = name
return reverse_dict

LABEl_NAME_MAP = get_label_name_map()
34 changes: 0 additions & 34 deletions libs/label_name_dict/pascal_dict.py

This file was deleted.

15 changes: 0 additions & 15 deletions libs/label_name_dict/remote_sensing_dict.py

This file was deleted.

Binary file removed libs/label_name_dict/remote_sensing_dict.pyc
Binary file not shown.
4 changes: 1 addition & 3 deletions tools/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
import os
import time
from data.io.read_tfrecord import next_batch
from libs.configs import cfgs
from libs.networks.network_factory import get_network_byname
from libs.label_name_dict.remote_sensing_dict import *
from libs.label_name_dict.label_dict import *
from libs.rpn import build_rpn
from help_utils.tools import view_bar
from tools import restore_model
import pickle
from libs.box_utils.coordinate_convert import *
from libs.box_utils.boxes_utils import get_horizen_minAreaRectangle
from libs.fast_rcnn import build_fast_rcnn
from libs.box_utils import iou_rotate

os.environ["CUDA_VISIBLE_DEVICES"] = '1'

Expand Down
3 changes: 1 addition & 2 deletions tools/eval1.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
import os
import time
from data.io.read_tfrecord import next_batch
from libs.configs import cfgs
from libs.networks.network_factory import get_network_byname
from libs.label_name_dict.remote_sensing_dict import *
from libs.label_name_dict.label_dict import *
from libs.rpn import build_rpn
from help_utils.tools import view_bar
from tools import restore_model
Expand Down
Binary file removed tools/inference_image/sample.tif
Binary file not shown.
Binary file added tools/inference_image/sample1.tif
Binary file not shown.
Binary file added tools/inference_image/sample2.tif
Binary file not shown.
Binary file added tools/inference_image/sample3.tif
Binary file not shown.
Binary file added tools/inference_image/sample4.tif
Binary file not shown.
Binary file added tools/inference_image/sample5.tif
Binary file not shown.

0 comments on commit c847b1a

Please sign in to comment.