Skip to content

Commit

Permalink
fix bulk search
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Oct 14, 2019
1 parent 62fa75a commit b6aa96f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cufacesearch/cufacesearch/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def put_post(self, mode):
"""
pid = os.getpid()
form = request.form
print("[put/post.{}] received parameters: {}".format(pid, form.keys()))
#print("[put/post.{}] received parameters: {}".format(pid, form.keys()))
if 'data' not in request.form.keys():
print("[put/post.{}] trying to parse input".format(pid))
form = json.loads(request.form.keys()[0])
Expand Down
9 changes: 6 additions & 3 deletions cufacesearch/cufacesearch/searcher/searcher_lopqhbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@ def search_from_feats(self, dets, feats, options_dict=dict()):
import time
# For multi-workers setting with gunicorn
self.set_pp(pp="SearcherLOPQHBase." + str(os.getpid()))
print("[{}.search_from_feats: LOG] searching for {} features from {} images".format(self.pp, len(feats), len(dets)))

start_search = time.time()
extr_str = self.build_extr_str()
Expand Down Expand Up @@ -1043,13 +1044,15 @@ def search_from_feats(self, dets, feats, options_dict=dict()):
sim_images.append([])
sim_score.append([])

all_sim_images.append(sim_images)
all_sim_dets.append([])
all_sim_score.append(sim_score)
all_sim_images.append(sim_images)
all_sim_dets.append([])
all_sim_score.append(sim_score)

search_time = time.time() - start_search
print("[{}: log] Full search performed in {:0.3}s.".format(self.pp, search_time))

print("[{}.search_from_feats: LOG] Returning {} lists of similar images".format(self.pp, len(all_sim_images)))

# format output
# print "all_sim_images",all_sim_images
# print "all_sim_dets",all_sim_dets
Expand Down

0 comments on commit b6aa96f

Please sign in to comment.