This file contains 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 solara as sl | |
import typing as t | |
import numpy as np | |
from plotly import graph_objects as go | |
from typing_extensions import TypedDict as TypedDictExt | |
Point = t.Tuple[float, float] | |
This file contains 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 solara as sl | |
from solara import lab as sl_lab | |
@sl.component | |
def Page(): | |
sl.Style( | |
""" | |
body { |
This file contains 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
#let _records-to-dict(records) = { | |
let formatted = (:) | |
for r in records { | |
for (k, v) in r { | |
let cur = formatted.at(k, default: ()) | |
cur.push(v) | |
formatted.insert(k, cur) | |
} | |
} | |
formatted |
This file contains 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 "@preview/cetz:0.2.0" | |
#let d = cetz.draw | |
#let offset(anchor, x: 0, y: 0) = { | |
(v => cetz.vector.add(v, (x, y)), anchor) | |
} | |
#let default-colors = (red, orange, yellow, green, blue, purple, fuchsia, gray) | |
#let color-boxed(..args) = { | |
set text(0.8em) | |
box( |
This file contains 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
🚧🚧🚧 This code has moved! 🚧🚧🚧 | |
View the latest changes at https://github.com/ntjess/wrap-it |
This file contains 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 numpy as np | |
import torch | |
from torch.nn.functional import conv2d | |
from skimage.util.shape import view_as_windows | |
# Try with values that don't have transpose symmetry | |
input_matrix_ = np.array( | |
[[3,9,0,1], | |
[2,8,1,1], | |
[3,4,8,1], |
This file contains 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
#!/usr/bin/env python | |
""" | |
Fast duplicate file finder. | |
Usage: duplicates.py <folder> [<folder>...] | |
Based on https://stackoverflow.com/a/36113168/300783 | |
Modified for Python3 with some small code improvements. | |
""" | |
import os | |
import sys |
This file contains 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 numpy as np | |
import cv2 as cv | |
from s3a import FR_SINGLETON, ComplexXYVertices, REQD_TBL_FIELDS as RTF, S3A, appInst | |
from s3a.processing import ProcessIO | |
from s3a.processing.processing import GlobalPredictionProcess | |
from pyqtgraph.Qt import QtCore | |
def findCircles(image: np.ndarray, nCircles=5, minRadius=6, maxRadius=200): | |
# row-col to x-y |
This file contains 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 s3a.parameditors import ParamEditorPlugin, ParamEditor, FR_SINGLETON | |
from skimage import io | |
class InfoExporterPlugin(ParamEditorPlugin): | |
name = 'Info Exporter' | |
@classmethod | |
def __initEditorParams__(cls): | |
super().__initEditorParams__() | |
cls.toolsEditor = ParamEditor.buildClsToolsEditor(cls, 'Tools') |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
x = np.random.normal((3,3)) | |
plt.imshow(x) | |
plt.show() |