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
#!/bin/bash | |
# Downloads and builds OpenCV with NVIDIA CUDA support. | |
# Builds C++ and Python libraries. | |
# To use in Python just import cv2 | |
echo -e "Building OpenCV with CUDA support...\n\n" | |
TEMP_DIR=$(mktemp -d) |
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
import cv2 | |
import numpy as np | |
from scipy import ndimage | |
""" Erosion with OpenCV """ | |
def Erosion_Opencv(img, kernel): | |
cv2.imshow("Input Image", img) | |
cv2.waitKey(0) | |
erosion = cv2.erode(img,kernel,iterations = 1) |
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
from tensorflow.keras.utils import Sequence | |
import numpy as np | |
class DatasetGenerator(Sequence): | |
""" | |
TensorFlow Dataset from Python/NumPy Iterator | |
""" | |
def __init__(self, filenames, batch_size=8, crop_dim=[240,240], augment=False, seed=816): | |
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
Contribution License Agreement | |
This Contribution License Agreement ("Agreement") is agreed to by the party signing below ("You"), and conveys certain license rights to the Intel Corporation ("Intel") for Your contributions to Intel open source projects. This Agreement is effective as of the latest signature date below. | |
1. Definitions. | |
"Code" means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to Intel under this Agreement. | |
"Project" means any of the projects owned or managed by Intel and offered under a license approved by the Open Source Initiative (www.opensource.org). | |
"Submit" is the act of uploading, submitting, transmitting, or distributing code or other content to any Project, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of discussing and improving that Project, but excluding communication that is |
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
# !/usr/bin/env python | |
import tensorflow as tf | |
from tensorflow.python.framework.convert_to_constants import convert_variables_to_constants_v2_as_graph | |
from tensorflow.lite.python.util import run_graph_optimizations, get_grappler_config | |
from pathlib import Path | |
import argparse | |
def frozen_keras_graph(model): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (c) 2020 Intel Corporation | |
# | |
# 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 |
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
import argparse | |
import tensorflow as tf | |
import os | |
import sys | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' | |
unlikely_output_types = ['Const', 'Assign', 'NoOp', 'Placeholder', 'Assert'] | |
def dump_for_tensorboard(graph_def: tf.GraphDef, logdir: str): |
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
# !/usr/bin/env python | |
""" | |
Copyright (c) 2018 Intel Corporation | |
| |
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 | |
|
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
import tensorflow as tf | |
import argparse | |
parser = argparse.ArgumentParser( | |
description="Loads TensorFlow protobuf and converts it to saved model", | |
add_help=True, formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
parser.add_argument("--filename", required=True, | |
help="the name and path of the HDF5 dataset") | |
parser.add_argument("--input_layer_name", default="import/shuffled_queue:0", |
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
#!/usr/bin/env python | |
# python openvino_inference.py -l /opt/intel/openvino/inference_engine/lib/libcpu_extension.so | |
import sys | |
import os | |
from argparse import ArgumentParser | |
import numpy as np | |
import logging as log | |
from timeit import default_timer as timer |
NewerOlder