This file contains hidden or 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 | |
IMAGE_SERVICE_URL = "https://api.inf-cv.uni-jena.de/imserver/" | |
IMAGE_SERVICE_SECRET = os.environ.get("IMAGE_SERVICE_SECRET", "secret_needed!") | |
IMAGE_SERVICE_SECRET_KEY = "Upload-Secret" |
This file contains hidden or 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 flask import Flask | |
from flask_migrate import Migrate | |
from flask_sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config["SQLALCHEMY_DATABASE_URI"] = f"sqlite:///testing.sqlite3" | |
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False | |
db = SQLAlchemy(app) |
This file contains hidden or 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
creds = dict(user="username", password="very_secure", db_name="sacred_experiments") | |
plotter = SacredPlotter(creds) | |
fig = plt.figure() | |
plotter.plot( | |
metrics=["accuracy", "loss"], | |
setups=[ | |
# cnn_type |
This file contains hidden or 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
<!-- save under "~/.config/sublime-text-3/Packages/User/pdb.sublime-snippet" --> | |
<snippet> | |
<content><![CDATA[import pdb; pdb.set_trace()]]></content> | |
<tabTrigger>pdb</tabTrigger> | |
<scope>source.python</scope> | |
<description>pdb debug tool</description> | |
</snippet> |
This file contains hidden or 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, logging | |
class Arg(object): | |
def __init__(self, *args, **kw): | |
super(Arg, self).__init__() | |
self.args = args | |
self.kw = kw | |
class FileArg(Arg): | |
def __init__(self, *args, **kw): |
This file contains hidden or 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
TEX=latexmk | |
OUT_FOLDER=.out | |
OPTS=-output-directory=${OUT_FOLDER} -pdf | |
PDF_VIEWER=okular | |
PDFS=YOUR_PDF.pdf | |
main: ${PDFS} | |
%.pdf : %.tex |
This file contains hidden or 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 chainer.functions.caffe import CaffeFunction | |
import pickle, logging | |
from os.path import isfile | |
class CaffeNetWrapper(object): | |
def __init__(self, caffe_model, chainer_model, force_caffe_load = False): | |
super(CaffeNetWrapper, self).__init__() | |
if not force_caffe_load and isfile(chainer_model): | |
logging.info("loading chainer model from \"{}\"".format(chainer_model)) |
This file contains hidden or 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
""" | |
- python2.7 32bit installieren (https://www.python.org/ftp/python/2.7.12/python-2.7.12.msi) | |
- C:\python\pip install pyperclip twain pillow | |
- C:\python\python.exe run.py | |
""" | |
import pyperclip, twain, os | |
from os.path import isdir, isfile, dirname, abspath | |
from PIL import Image |
This file contains hidden or 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 converter import extract | |
from os import path | |
import argparse, simplejson as json | |
def generateJson(lectureId, outdir, images): | |
if not outdir.endswith("/"): outdir += "/" | |
sync_file = path.join(outdir, "sync") | |
json_obj = {"lectureId": lectureId, "images": []} | |
with open(sync_file) as f: | |
for line in f: |
This file contains hidden or 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(Boost_INCLUDE_DIRS @Boost_INCLUDE_DIRS@) | |
set(Boost_LIBRARIES @Boost_LIBRARIES@) | |
link_directories(@Boost_LINK_DIRS@) | |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} @Boost_C_FLAGS@") | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} @Boost_CXX_FLAGS@") |
NewerOlder