Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlejoCR
AlejoCR / retrain.py
Last active May 7, 2021 05:35
retrain.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import collections
from datetime import datetime
import hashlib
import os.path
import random
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
import cv2
from PIL import Image
video_capture = cv2.VideoCapture(get_jetson_gstreamer_source(), cv2.CAP_GSTREAMER)
if not (video_capture.isOpened()):
print("Could not open video device")
#To set the resolution
==21650== NVPROF is profiling process 21650, command: /root/.virtualenvs/cv/bin/python -m cProfile -o out.prof retrain/label_image.py --graph=retrain/output_graph.pb --labels=retrain/output_labels.txt --input_layer=Placeholder --output_layer=final_result --image=test-images/lego1.jpeg
==21650== Warning: Unified Memory Profiling is not supported on the underlying platform. System requirements for unified memory can be found at: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements
==21650== Profiling application: /root/.virtualenvs/cv/bin/python -m cProfile -o out.prof retrain/label_image.py --graph=retrain/output_graph.pb --labels=retrain/output_labels.txt --input_layer=Placeholder --output_layer=final_result --image=test-images/lego1.jpeg
==21650== Profiling result:
Type Time(%) Time Calls Avg Min Max Name
GPU activities: 58.41% 815.49ms 128 6.3710ms 789.76us 25.076ms maxwell_gcgemm_64x64_nt
5.90% 82.383ms