Skip to content

Instantly share code, notes, and snippets.

View loretoparisi's full-sized avatar
🐍
NightShift

Loreto Parisi loretoparisi

🐍
NightShift
View GitHub Profile
@loretoparisi
loretoparisi / twitter_topic.json
Created April 2, 2021 17:29
Twitter Topic - as seen on twitter.com
["Technology", "Investing", "Books", "Gaming", "Computer programming", "Tech news", "Machine learning", "Travel", "Web development", "Arts & culture news", "World news", "Movies", "Home improvement", "Arts & crafts", "Dogs", "Philosophy", "Comedy", "Space", "Business & finance", "Pets", "Information security", "Neon Genesis Evangelion", "Cybersecurity", "Science", "Interior design", "Bitcoin cryptocurrency", "Education", "Architecture", "National parks", "Movies & TV", "Business news", "Food", "PlayStation 5", "Disney", "Fashion", "Psychology", "Language learning", "Gardening", "Fitness", "Music", "Sci-fi & fantasy films", "Science news", "Artificial intelligence", "Visual arts", "Home & family", "Cats", "Cooking", "Harry Potter", "Gaming consoles", "Animal Crossing", "Digital creators", "Sci-fi & fantasy", "Animation", "Star Wars", "Art", "Classic rock", "Tattoos", "Painting", "Travel guides", "Guitar", "History", "PlayStation", "Inspirational quotes", "Running", "PC gaming", "Mobile Suit Gundam", "Gaming ne
@loretoparisi
loretoparisi / twitter_topic_grouped.json
Created April 2, 2021 17:27
Twitter Topics grouped - as seen on twitter.com
[
["Technology", "Investing", "Books"],
["Gaming", "Computer programming", "Tech news"],
["Machine learning", "Travel", "Web development"],
["Arts & culture news", "World news", "Movies"],
["Home improvement", "Arts & crafts", "Dogs"],
["Philosophy", "Comedy", "Space"],
["Business & finance", "Pets", "Information security"],
["Neon Genesis Evangelion", "Cybersecurity", "Science"],
["Interior design", "Bitcoin cryptocurrency", "Education"],
{
"jobName": "TranscribeSample",
"accountId": "123456789",
"results": {
"transcripts": [
{
"transcript": "Hi. My name is John McCollum. I'm a writer at large for The New York Times Magazine. And in 2016, I wrote a piece for the magazine about clouds. Yeah, it's a story about clouds. It doesn't sound very important, and I"
}
],
"speaker_labels": {
@loretoparisi
loretoparisi / tensorflow_docker_gpu_core2_build_system_info.log
Created February 2, 2021 08:27
tensorflow_docker_gpu_core2_build_system_info
root@55166535ad1d:/tensorflow_src# bash <(curl -s https://raw.githubusercontent.com/tensorflow/tensorflow/master/tools/tf_env_collect.sh) && cat tf_env.txt
Collecting system information...
Traceback (most recent call last):
File "/tmp/check_tf.py", line 1, in <module>
import tensorflow as tf;
ModuleNotFoundError: No module named 'tensorflow'
WARNING: Package(s) not found: tensorflow
Wrote environment to tf_env.txt. You can review the contents of that file.
and use it to populate the fields in the github issue template.
@loretoparisi
loretoparisi / tensorflow_docker_gpu_core2_build_error.log
Created February 2, 2021 06:55
executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
loreto@ombromanto:~/Projects/docker-gpu-mnoavx$ docker run --gpus all -it -w /tensorflow -v $PWD:/mnt -e HOST_PERMS="$(id -u):$(id -g)" tensorflow/tensorflow:devel-gpu
________ _______________
___ __/__________________________________ ____/__ /________ __
__ / _ _ \_ __ \_ ___/ __ \_ ___/_ /_ __ /_ __ \_ | /| / /
_ / / __/ / / /(__ )/ /_/ / / _ __/ _ / / /_/ /_ |/ |/ /
/_/ \___//_/ /_//____/ \____//_/ /_/ /_/ \____/____/|__/
WARNING: You are running this container as root, which can cause new files in
@loretoparisi
loretoparisi / tokenizer_unicode.js
Last active October 15, 2020 11:31
Unicode aware Regex Tokenizer in JavaScript with token char offset begin and end
function aggressive_tokenizer(text) {
// most punctuation
text = text.replace(/[^\w\.\-\/\+\<\>,&]/g, " $& ");
// commas if followed by space
text = text.replace(/(,\s)/g, " $1");
// single quotes if followed by a space
text = text.replace(/('\s)/g, " $1");
// single quotes if last char
text = text.replace(/('$)/, " $1");
text = text.replace(/(\s+[`'"‘])(\w+)\b(?!\2)/g, " $2");
@loretoparisi
loretoparisi / test.js
Created October 2, 2020 16:21
TFJS Test for EfficientDet Models
const fs = require('fs');
const path = require('path');
const log = require('@vladmandic/pilogger');
const tf = require('@tensorflow/tfjs');
const tfnode = require('@tensorflow/tfjs-node');
function getTensorFromImage(path) {
if (!fs.existsSync(path)) return null;
const data = fs.readFileSync(path);
const tfimage = tfnode.node.decodeImage(data);
#!/bin/bash
count() {
awk 'BEGIN {
unit["Bytes"] = 1;
unit["kB"] = 10**3;
unit["MB"] = 10**6;
unit["GB"] = 10**9;
@loretoparisi
loretoparisi / numpy_json_encoder.py
Created June 18, 2020 14:06
Python Numpy JSON Encoder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @author loretoparisi at gmail dot com
# Copyright (c) 2020 Loreto Parisi
#
import numpy as np
import json
@loretoparisi
loretoparisi / dataset_stats.py
Created June 18, 2020 14:04
Dataset Statistics with Python Pandas
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @author loretoparisi at gmail dot com
# Copyright (c) 2020 Loreto Parisi
#
### built-in
import argparse
import json