convert original.pdf -colorspace gray +clone -blur 0x1 +swap -compose divide -composite -linear-stretch 5%x0% -rotate 1.5 fake-scanned.pdf
Colorscan variation:
from flask import Flask, request | |
from sqlalchemy import Column, Integer, String | |
from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine | |
from sqlalchemy.future import select | |
from sqlalchemy.orm import declarative_base, sessionmaker | |
engine = create_async_engine('sqlite+aiosqlite:///./db.db') | |
async_session = sessionmaker( | |
engine, expire_on_commit=False, class_=AsyncSession | |
) |
class Corpus { | |
name: string; | |
} | |
@TrucAngularAUZEF | |
class MyCorporaComponent extends OnInit { | |
listCorpora : Array<Corpus> = []; | |
constructor(private api: MyAPIServiceDeLEspace){} |
The fundamental unit in PyTorch is the Tensor. This post will serve as an overview for how we implement Tensors in PyTorch, such that the user can interact with it from the Python shell. In particular, we want to answer four main questions:
PyTorch defines a new package torch
. In this post we will consider the ._C
module. This module is known as an "extension module" - a Python module written in C. Such modules allow us to define new built-in object types (e.g. the Tensor
) and to call C/C++ functions.
#!/bin/bash | |
gst-launch-1.0 -v udpsrc uri=udp://239.1.1.1:5000 caps="application/x-rtp,channels=(int)2,format=(string)S16LE,media=(string)audio,payload=(int)96,clock-rate=(int)44100,encoding-name=(string)L24" ! rtpL24depay ! audioconvert ! autoaudiosink sync=false |
import numpy as np | |
from numba import jit | |
def levenshtein(x, y): | |
""" levenshtein distance for iterable sequences | |
""" | |
# check type | |
if (np.all(map(type, x)) is str) and (np.all(map(type, y)) is str): | |
_x = np.array(x, dtype=np.str) |
from flask import Flask, Response | |
app = Flask(__name__) | |
@app.route("/wav") | |
def streamwav(): | |
def generate(): | |
with open("signals/song.wav", "rb") as fwav: | |
data = fwav.read(1024) |
# As the Kivy docs ( http://kivy.org/docs/guide/other-frameworks.html ) state: | |
# install_twisted_rector must be called before importing and using the reactor. | |
from kivy.support import install_twisted_reactor | |
install_twisted_reactor() | |
from autobahn.twisted.websocket import WebSocketClientProtocol, \ | |
WebSocketClientFactory | |
class MyKivyClientProtocol(WebSocketClientProtocol): |
convert Image-0001.png Image-0002.png -depth 2 -colorspace Gray output.tiff |