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 os | |
import Image | |
def mergeImages(images): | |
if len(images) > 0: | |
merged = Image.new('RGB', (images[0].size[0], images[0].size[1]), "black") | |
pixels = merged.load() |
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 os | |
import argparse | |
ap = argparse.ArgumentParser() | |
ap.add_argument("-i", "--input", required=True, help="path to dir with input videos") | |
ap.add_argument("-f", "--fps", type=int, default=5, help="FPS of output video") | |
args = vars(ap.parse_args()) | |
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 keras.applications.inception_v3 import InceptionV3 | |
# from keras.applications.resnet50 import ResNet50 | |
from keras.applications.mobilenet import MobileNet | |
from keras.preprocessing import image | |
from keras.models import Model | |
from keras.layers import Dense, GlobalAveragePooling2D | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.callbacks import ModelCheckpoint | |
from keras import backend as K |
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 keras.applications.inception_v3 import InceptionV3 | |
# from keras.applications.resnet50 import ResNet50 | |
from keras.applications.mobilenet import MobileNet | |
from keras.preprocessing import image | |
from keras.models import Model | |
from keras.layers import Dense, GlobalAveragePooling2D | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.callbacks import ModelCheckpoint | |
from keras import backend as K |
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 os | |
import numpy as np | |
from keras.applications.mobilenet import MobileNet | |
from keras.models import Sequential, Model | |
from keras.layers import Input, Dense, Activation, GlobalAveragePooling2D, Reshape, Conv2D, Dropout | |
from keras.optimizers import adam | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.callbacks import ModelCheckpoint, TensorBoard, ReduceLROnPlateau, EarlyStopping |
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 os | |
data_dir = "./data/" | |
train_dir = "./train/" | |
val_dir = "./val/" | |
breed_names = os.listdir(data_dir) | |
for breed_name in breed_names: | |
if not os.path.isdir(train_dir + breed_name): | |
os.mkdir(train_dir + breed_name) |
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 os | |
import cv2 | |
from tqdm import tqdm | |
import numpy as np | |
import pandas as pd | |
from keras.applications.mobilenet import MobileNet | |
from keras.models import Model | |
from keras.layers import Activation, GlobalAveragePooling2D, Dense |
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
NUM_CARDS=2 | |
NS="/usr/bin/nvidia-settings" | |
while true | |
do | |
for ((i=0; i<$NUM_CARDS;i++)) | |
{ | |
GPU_TEMP='nvidia-smi -i $i --query-gpu=temperature.gpu --format=csv,noheader' | |
FAN_SPEED='nvidia-smi -i $i --query-gpu=fan.speed --format=csv,noheader,nounits' | |
if (($GPU_TEMP > 50)): then |
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
nvidia-settings -a '[gpu:0]/GPUMemoryTransferRateOffset[3]=800'; | |
nvidia-settings -a '[gpu:0]/GPUGraphicsClockOffset[3]=180'; | |
nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=1'; | |
nvidia-settings -a '[gpu:0]/GPUFanControlState=1'; | |
nvidia-settings -a '[fan:0]/GPUTargetFanSpeed=40'; |
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
sudo nvidia-xconfig -a --cool-bits=31 --allow-empty-initial-configuration --enable-all-gpus | |
sudo nano /etc/X11/xorg.conf | |
Option "RegistryDwords" "PerfLevelScr=0x2222" |
OlderNewer