forked from peteanderson80/Matterport3DSimulator
-
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.
Working precompute_img_features.py script
- Loading branch information
1 parent
ee2999f
commit c487470
Showing
4 changed files
with
95 additions
and
16 deletions.
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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
*~ | ||
data | ||
build | ||
img_features | ||
*.tsv | ||
sim_imgs | ||
*.so | ||
*kdev4* | ||
*.caffemodel | ||
*.caffemodel.h5 | ||
*.pyc | ||
*.out |
Empty file.
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
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,32 @@ | ||
# -------------------------------------------------------- | ||
# Fast R-CNN | ||
# Copyright (c) 2015 Microsoft | ||
# Licensed under The MIT License [see LICENSE for details] | ||
# Written by Ross Girshick | ||
# -------------------------------------------------------- | ||
|
||
import time | ||
|
||
class Timer(object): | ||
"""A simple timer.""" | ||
def __init__(self): | ||
self.total_time = 0. | ||
self.calls = 0 | ||
self.start_time = 0. | ||
self.diff = 0. | ||
self.average_time = 0. | ||
|
||
def tic(self): | ||
# using time.time instead of time.clock because time time.clock | ||
# does not normalize for multithreading | ||
self.start_time = time.time() | ||
|
||
def toc(self, average=True): | ||
self.diff = time.time() - self.start_time | ||
self.total_time += self.diff | ||
self.calls += 1 | ||
self.average_time = self.total_time / self.calls | ||
if average: | ||
return self.average_time | ||
else: | ||
return self.diff |