Skip to content

Instantly share code, notes, and snippets.

View apacha's full-sized avatar

Alexander Pacha apacha

View GitHub Profile
import torch
import torch.nn as nn
from PIL import Image
from pytorch_lightning import LightningModule, Trainer
from torch import optim
from torch.nn import Conv2d, MaxPool2d
from torch.utils.data import DataLoader
from torchvision.datasets import VisionDataset
from torchvision.transforms import transforms
import numpy as np
absl-py==0.9.0
cachetools==4.1.0
certifi==2020.4.5.2
chardet==3.0.4
cycler==0.10.0
decorator==4.4.2
future==0.18.2
google-auth==1.17.2
google-auth-oauthlib==0.4.1
grpcio==1.29.0
@apacha
apacha / musescore-docker.sh
Created August 1, 2018 15:36
Compile and run MuseScore inside Docker for creating OMR annotation data
apt-get update
apt-get install git cmake g++ libasound2-dev portaudio19-dev libmp3lame-dev libsndfile1-dev libportmidi-dev libssl-dev libpulse-dev libfreetype6-dev libfreetype6 qtcreator libqt4-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtquick1-5-dev qtscript5-dev libqt5xmlpatterns5-dev libqt5svg5-dev libqt5webkit5-dev
cd ~
git clone https://github.com/musescore/MuseScore.git
git checkout imeta
mscore file.mscz -o file.png -E
./build.release/mscore/mscore -platform offscreen demos/All_Dudes.mscz -o demos/All_Dudes.png -E
@apacha
apacha / SampleClassifier.py
Last active May 9, 2017 18:52
Load model failes in Keras for this model
import datetime
import os
from time import time
import keras
import numpy as np
from keras.callbacks import EarlyStopping, ModelCheckpoint, ReduceLROnPlateau
from keras.preprocessing.image import ImageDataGenerator
from keras.layers import Activation, BatchNormalization, Convolution2D, Dense, Dropout, Flatten, MaxPooling2D
from keras.models import Sequential
@apacha
apacha / path_tools.py
Created March 17, 2017 16:53
Path Tools
import inspect
import os
import sys
def get_solution_directory() -> str:
# Assumes that all scripts that are actually executed reside in a sub-folder of AssignmentX,
# e.g. Assignment2/TestScripts, therefore returns the parent of the currently executed file
solution_directory = os.path.realpath(
os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
@apacha
apacha / InstallationLog.txt
Created February 26, 2017 21:51
Pip Install-Log tensorflow on Windows
D:\Entwicklungen\DeepLearningForComputerVision\Assignment3>pip3 -V
pip 9.0.1 from c:\programming\anaconda3\lib\site-packages (python 3.5)
D:\Entwicklungen\DeepLearningForComputerVision\Assignment3>pip -V
pip 9.0.1 from c:\programming\anaconda3\lib\site-packages (python 3.5)
D:\Entwicklungen\DeepLearningForComputerVision\Assignment3>pip3 install --upgrade tensorflow-gpu
Requirement already up-to-date: tensorflow-gpu in c:\programming\anaconda3\lib\site-packages
Requirement already up-to-date: numpy>=1.11.0 in c:\programming\anaconda3\lib\site-packages (from tensorflow-gpu)
Requirement already up-to-date: six>=1.10.0 in c:\programming\anaconda3\lib\site-packages (from tensorflow-gpu)
@apacha
apacha / InstallationLog.txt
Created February 26, 2017 19:17
Installation log of Tensorflow 1.0 on Windows using pip
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\Alex>pip3 -V
pip 9.0.1 from c:\programming\anaconda3\lib\site-packages (python 3.5)
C:\Users\Alex>pip3 install --upgrade tensorflow
Collecting tensorflow
Downloading tensorflow-1.0.0-cp35-cp35m-win_amd64.whl (14.7MB)
100% |################################| 14.7MB 94kB/s
@apacha
apacha / app.gradle
Created December 23, 2016 14:11
Automatic Versioning for gradle-based Android applications on Bitrise CI
// When running on the Bitrise-CI, this will return the build-number. Otherwise use 0
def buildNumber = System.getenv("BITRISE_BUILD_NUMBER") as Integer ?: 0
// Use your own current version number
def versionNumber = "1.0."
android {
...
defaultConfig {
...
versionCode buildNumber
@apacha
apacha / ApplyVersionToAssemblies.ps1
Created July 1, 2016 18:49
Replace version-number in Visual Studio Team Service Build
##-----------------------------------------------------------------------
## <copyright file="ApplyVersionToAssemblies.ps1">(c) Microsoft Corporation. This source is subject to the Microsoft Permissive License. See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. All other rights reserved.</copyright>
##-----------------------------------------------------------------------
# Look for a 0.0.0.0 pattern in the build number.
# If found use it to version the assemblies.
#
# For example, if the 'Build number format' build process parameter
# $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
# then your build numbers come out like this:
# "Build HelloWorld_2013.07.19.1"
@apacha
apacha / ApplyVersionToAssemblies.sh
Last active July 4, 2016 14:26
Replace version-number in Visual Studio Team Service Build
#!/bin/bash
# Sample call: ./ApplyVersionToAssemblies.sh ../Source/ AssemblyInfo.cs XamarinAndroid_1.0.0.1
echo "Script to automatically set the version-number in files (e.g. AssemblyInfo.cs)"
if [ $# -ne 3 ]; then
echo "Usage: $0 path_to_search filename build_number"
exit
fi