Skip to content

Commit 6372dd9

Browse files
committed
Profiling attempt
1 parent f69c39e commit 6372dd9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

__init__.py

Whitespace-only changes.

datasets/FaceVideoDataset.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
from utils.FaceDetector import FAN, MTCNN
2525
from facenet_pytorch import InceptionResnetV1
2626

27+
from memory_profiler import profile
28+
29+
2730
class FaceVideoDataModule(pl.LightningDataModule):
2831

2932
def __init__(self, root_dir, output_dir, processed_subfolder=None,
@@ -151,6 +154,7 @@ def _get_path_to_sequence_reconstructions(self, sequence_id):
151154
out_folder = Path(self.output_dir) / suffix
152155
return out_folder
153156

157+
@profile
154158
def _detect_faces_in_sequence(self, sequence_id):
155159
# if self.detection_lists is None or len(self.detection_lists) == 0:
156160
# self.detection_lists = [ [] for i in range(self.num_sequences)]
@@ -222,6 +226,7 @@ def load_detections(fname):
222226
last_frame_id = -1
223227
return detection_fnames, centers, sizes, last_frame_id
224228

229+
@profile
225230
def _detect_faces_in_image(self, image_path):
226231
# imagepath = self.imagepath_list[index]
227232
# imagename = imagepath.split('/')[-1].split('.')[0]
@@ -658,7 +663,7 @@ def create_reconstruction_video_with_recognition(self, sequence_id, overwrite=Fa
658663
baseoutfile = "video_with_labels.mp4"
659664
else:
660665
baseoutfile = "video_with_labels_thresh_%.03f.mp4" % distance_threshold
661-
outfile = vis_fnames[0].parents[1] /baseoutfile
666+
outfile = vis_fnames[0].parents[1] / baseoutfile
662667

663668
print("Creating reconstruction video for sequence num %d: '%s' " % (sequence_id, self.video_list[sequence_id]))
664669
if outfile.exists() and not overwrite:

0 commit comments

Comments
 (0)