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 cv2 | |
import sys | |
import numpy as np | |
import mxnet as mx | |
from PyQt5.QtWidgets import QApplication | |
QApplication(sys.argv) # comment it | |
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 redis | |
import json | |
data = { | |
'foo': 'bar', | |
'd': {'a': 1} | |
} | |
r = redis.StrictRedis() | |
r.execute_command('JSON.SET', 'doc', '.', json.dumps(data)) |
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 __future__ import absolute_import, division, print_function, unicode_literals | |
from tensorflow.keras import layers | |
try: | |
# %tensorflow_version only exists in Colab. | |
%tensorflow_version 2.x | |
except Exception: | |
pass | |
import tensorflow as tf |
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 tensorflow/tensorflow:1.15.0-gpu-py3 | |
RUN addgroup --gid 1001 user && \ | |
adduser --disabled-password --gecos '' -u 1000 --gid 1001 --home /home/user recogniser | |
WORKDIR /home/user | |
RUN apt-get update && \ | |
apt-get -y install --no-install-recommends --no-upgrade build-essential cmake \ | |
libopenblas-dev liblapack-dev libx11-dev libgtk-3-dev cuda-toolkit-10-0 |
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 json | |
from pathlib import Path | |
import pandas as pd | |
# from matplotlib.pyplot import plt | |
from matplotlib import pyplot as plt | |
%matplotlib inline | |
with Path('/home/roman/dev/vinteo/backend/measurement.json').open() as f: | |
m = json.load(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
CREATE OR REPLACE FUNCTION match_documents( | |
query_embedding VECTOR(1536), | |
match_count INT, | |
metadata_filter JSONB DEFAULT NULL, | |
similarity_threshold FLOAT DEFAULT 2.0, | |
target_table TEXT DEFAULT 'message_documents' | |
) | |
RETURNS TABLE(id BIGINT, content TEXT, metadata JSONB, similarity FLOAT) | |
LANGUAGE plpgsql | |
AS $$ |
OlderNewer