Skip to content

Instantly share code, notes, and snippets.

@radezet
radezet / generate_noise_images.py
Created February 14, 2018 11:42
Generate noise images
import numpy as np
from PIL import Image
for i in range(100):
noise = np.random.rand(28, 28, 3) * 255
noise_img = Image.fromarray(noise.astype('uint8'))
noise_img.save(str(i) + '.jpg')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
train=pd.read_csv('run_train,tag_accuracy_1.csv', sep=',', header=0)
val=pd.read_csv('run_validation,tag_accuracy_1.csv', sep=',', header=0)
def annot_max(x, y, ax=None):
import os
import csv
from PIL import Image
output = 'flower_split'
with open('flower_labels.csv') as csvfile:
label_reader = csv.reader(csvfile, delimiter=',')
next(label_reader) # skipping header
import os
import random
from glob import glob
from PIL import Image
INPUT = 'flower_split'
VAL_NUMBER = 4
def get_files(path):
dirs = [x[0] for x in os.walk(path)][1:]
import os
from glob import glob
from datetime import datetime
from shutil import copyfile
import imgaug as ia
from imgaug import augmenters as iaa
from scipy.misc import imsave, imread
INPUT = 'test'
import os
from glob import glob
from datetime import datetime
from shutil import copyfile
import imgaug as ia
from imgaug import augmenters as iaa
from scipy.misc import imsave, imread
INPUT = 'flower_split'
# Copyright 2015 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,