Skip to content

Instantly share code, notes, and snippets.

View dandelin's full-sized avatar
📚
Reading Papers

Wonjae Kim dandelin

📚
Reading Papers
View GitHub Profile
@dandelin
dandelin / convert_pyarrow.py
Created April 6, 2022 09:09 — forked from csarron/convert_pyarrow.py
pip install pyarrow fire tqdm
"""
crawl images:
pip install img2dataset==1.11.0
img2dataset --url_list cc3m.tsv\
--output_folder cc3m-img --input_format "tsv"\
--url_col "url" --caption_col "caption"\
--output_format files --resize_mode=no\
--processes_count 10 --thread_count 64 --number_sample_per_shard 2000\
--enable_wandb True --save_metadata False
{"0": "net", "1": "pitcher", "2": "orange", "3": "yes", "4": "white", "5": "skiing", "6": "red", "7": "frisbee", "8": "brushing teeth", "9": "no", "10": "black and white", "11": "skateboard", "12": "1", "13": "blue", "14": "green", "15": "motorcycle", "16": "gray", "17": "2", "18": "purse", "19": "skis", "20": "poles", "21": "surfboard", "22": "dog", "23": "on", "24": "office", "25": "large", "26": "very big", "27": "laptop", "28": "vent", "29": "computer", "30": "black", "31": "bear", "32": "3", "33": "wii", "34": "glasses", "35": "tree", "36": "eating", "37": "log", "38": "5", "39": "raft", "40": "left", "41": "living room", "42": "pink", "43": "right", "44": "railing", "45": "grass", "46": "wire", "47": "10 years", "48": "knife", "49": "cake", "50": "banana", "51": "chef", "52": "vanilla", "53": "4", "54": "outdoor", "55": "mustard", "56": "bun", "57": "clouds", "58": "dock", "59": "brown", "60": "silver", "61": "refrigerator", "62": "square", "63": "teddy", "64": "elm", "65": "stripes", "66": "baseball",
@dandelin
dandelin / split.py
Created September 18, 2020 00:19
split pdfs
"""
pip install git+https://github.com/dandelin/PyPDF2.git
"""
from glob import glob
from PyPDF2 import PdfFileReader, PdfFileWriter
def split_pdf(path, p):
if path.endswith('_0.pdf') or path.endswith('_1.pdf'):
return
@dandelin
dandelin / q161
Created November 25, 2016 14:10
q161
<svg>
<- selection scope
<rect></rect>
<rect></rect> <- binded with apple in 1.csv
<rect></rect> <- binded with grape in 1.csv
<rect></rect> <- binded with orange in 1.csv
<rect></rect>
<rect:selection></rect> <- binded with kiwi in 2.csv
</svg>
#include <iostream>
#include <string>
#include <map>
#include <limits>
#include <functional>
using namespace std;
class Value {
private:
#include <iostream>
#include <string>
#include <map>
#include <limits>
#include <functional>
using namespace std;
class Value {
private:
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{