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 python3 | |
import csv | |
import os | |
import tkinter as tk | |
import xml.etree.ElementTree as ET | |
from pathlib import Path | |
from tkinter import filedialog, messagebox | |
def get_properties(element): |
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 pathlib import Path | |
import timm | |
import torch | |
from PIL import Image | |
class FeatureExtractor: | |
"""Extract embeddings from images using timm's Dinov2 models""" | |
model_names = ( |
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
# Requirements: | |
# sudo apt update && sudo apt install -y cmake | |
# pip install face-recognition numpy opencv-python Pillow tqdm | |
import cv2 | |
import face_recognition | |
import numpy as np | |
from PIL import Image | |
from tqdm import tqdm | |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
cidade_exterior | |
ABLASSERDAN | |
A CORUNA | |
ACRA | |
ADDISON | |
AGUEDA | |
AICHI-KEN | |
ALAMEDA | |
ALBLASSERDAM | |
ALCALA DE HENARES |
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 datetime | |
import time | |
def timezoned_now(): | |
"""Equivalent to `datetime.datetime.now()` but replaces `tzinfo` with local timezone offset""" | |
offset = time.timezone if time.localtime().tm_isdst == 0 else time.altzone | |
delta = datetime.timedelta(seconds=-offset) | |
timezone = datetime.timezone(offset=delta) |
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
#!/bin/bash | |
# XXX: replace /dev/sdb1 with the partition you'd like to rescue | |
sudo apt update && sudo apt install -y gddrescue | |
sudo time ddrescue /dev/sdb1 /path/to/file.raw /path/to/ddrescue.log --try-again --force --verbose | |
sudo mkdir -p /mnt/rescued | |
sudo mount -o ro,loop /path/to/file.raw /mnt/rescued | |
cd /mnt/rescued # enjoy :) |
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
# pip install srt | |
import argparse | |
import srt | |
parser = argparse.ArgumentParser() | |
parser.add_argument("input_filename") | |
parser.add_argument("output_filename") | |
args = parser.parse_args() |
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
# pip install pillow cached-property pdfminer.six https://github.com/turicas/rows/archive/develop.zip | |
import argparse | |
from rows.plugins.plugin_pdf import ( | |
RectObject, | |
TextObject, | |
PDFMinerBackend, | |
group_objects, | |
YGroupsAlgorithm, | |
plot_objects, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder