- Download FFmpeg
- Extract it and save it to C drive ( choose any location - it's optional )
- Set environment variable - copy the location of bin folder which is inside the extracted file and set the location on system path variable.
- Done!
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 | |
from tensorflow.keras import layers | |
H_AXIS = -3 | |
W_AXIS = -2 | |
class RandomCutout(layers.Layer): | |
"""Randomly cut out rectangles from images and fill them. | |
Args: |
- Dowload Putty
- Dowload Xming X Server
Install all of them and using putty remotely access to raspberry pi. We need to configure something.Type following command to edit a config file.
sudo nano /etc/ssh/ssh_config
following item need to change..
For left alignment
<img align="left" width="600" height="200" src="https://www.python.org/python-.png">
For right alignment
<img align="right" width="600" height="200" src="https://www.python.org/python-.png">
And for center alignment
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
# set plot figure size | |
fig, c_ax = plt.subplots(1,1, figsize = (12, 8)) | |
def multiclass_roc_auc_score(y_test, y_pred, average="macro"): | |
lb = LabelBinarizer() | |
lb.fit(y_test) | |
y_test = lb.transform(y_test) | |
y_pred = lb.transform(y_pred) | |
for (idx, c_label) in enumerate(all_labels): # all_labels: no of the labels, for ex. ['cat', 'dog', 'rat'] |
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 | |
from tensorflow import keras | |
from tensorflow.keras import Model | |
from tensorflow.keras import layers | |
class ConvoBlocks(tf.keras.layers.Layer): | |
def __init__(self, num_filters=256, | |
kernel_size=3, dilation_rate=1, | |
padding="same", use_bias=False, **kwargs): | |
super(ConvoBlocks, self).__init__(**kwargs) |
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
# Case 2: Multiple Class Maks | |
# String to integer labels. | |
# Assuming we havae 5 classes like below (excluding background). | |
categories = { | |
'human' : 1, | |
'dog' : 2, | |
'cat' : 3, | |
'bus' : 4, | |
'road' : 5 |
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
# RESTRICT TENSORFLOW TO 2GB OF GPU RAM | |
# SO THAT WE HAVE 14GB RAM free | |
LIMIT = 2.0 | |
gpus = tf.config.experimental.list_physical_devices('GPU') | |
if gpus: | |
try: | |
tf.config.experimental.set_virtual_device_configuration( | |
gpus[0], | |
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=1024*LIMIT)]) | |
logical_gpus = tf.config.experimental.list_logical_devices('GPU') |
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
""" | |
Reference | |
# https://github.com/fuenwang/PanoramaUtility | |
# https://github.com/fuenwang/Equirec2Perspec | |
# https://github.com/fuenwang/PanoramaUtility | |
# https://github.com/timy90022/Perspective-and-Equirectangular | |
""" | |
import os | |
import sys |
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
# Base Image: Ubuntu + Cuda | |
FROM nvidia/cuda:11.0.3-devel-ubuntu20.04 AS python_base_cuda | |
# ENV SET | |
ENV PYTHONUNBUFFERED=1 \ | |
PYTHONFAULTHANDLER=1 \ | |
PYTHONHASHSEED=random \ | |
PYTHONDONTWRITEBYTECODE=1 \ | |
PIP_NO_CACHE_DIR=off \ | |
PIP_DISABLE_PIP_VERSION_CHECK=on \ |
NewerOlder