3
3
import tensorflow .contrib .slim as slim
4
4
import random
5
5
import time
6
+ import subprocess
6
7
import string
7
8
import os
8
9
import threading
9
- from scipy import misc
10
10
import tensorflow as tf
11
11
import numpy as np
12
+ from scipy import misc
13
+ from scipy .misc import imread , imresize
12
14
from distutils .version import LooseVersion
13
15
if LooseVersion (tf .__version__ ) >= LooseVersion ('1.0' ):
14
16
rnn_cell = tf .contrib .rnn
24
26
np .random .seed (0 )
25
27
26
28
from utils import train_utils , googlenet_load , tf_concat
29
+ from utils .annolist import AnnotationLib as al
30
+ from utils .train_utils import add_rectangles , rescale_boxes
27
31
28
32
@ops .RegisterGradient ("Hungarian" )
29
33
def _hungarian_grad (op , * args ):
@@ -536,7 +540,7 @@ def get_image_dir(self, weights, expname, test_boxes):
536
540
image_dir = '%s/images_%s_%d%s' % (os .path .dirname (weights ), os .path .basename (test_boxes )[:- 5 ], weights_iteration , expname )
537
541
return image_dir
538
542
539
- def eval (self , weights , test_boxes , min_conf , tau , show_supressed , expname ):
543
+ def eval (self , weights , test_boxes , min_conf , tau , show_suppressed , expname ):
540
544
self .H ["grid_width" ] = self .H ["image_width" ] / self .H ["region_size" ]
541
545
self .H ["grid_height" ] = self .H ["image_height" ] / self .H ["region_size" ]
542
546
x_in = tf .placeholder (tf .float32 , name = 'x_in' , shape = [self .H ['image_height' ], self .H ['image_width' ], 3 ])
@@ -548,7 +552,7 @@ def eval(self, weights, test_boxes, min_conf, tau, show_supressed, expname):
548
552
if self .H ['reregress' ]:
549
553
pred_boxes = pred_boxes + pred_boxes_deltas
550
554
else :
551
- pred_boxes , pred_logits , pred_confidences = tensorbox .build_forward (tf .expand_dims (x_in , 0 ), 'test' , reuse = None )
555
+ pred_boxes , pred_logits , pred_confidences = self .build_forward (tf .expand_dims (x_in , 0 ), 'test' , reuse = None )
552
556
saver = tf .train .Saver ()
553
557
with tf .Session () as sess :
554
558
sess .run (tf .global_variables_initializer ())
0 commit comments