Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

View jo-chemla's full-sized avatar

Jonathan Chemla jo-chemla

View GitHub Profile
@jo-chemla
jo-chemla / fab-api.py
Created October 24, 2024 10:14
FAB.com - Add to library all listings from seller
"""
Get listing-ids via GET to https://www.fab.com/i/listings/search?currency=USD&seller=Quixel&sort_by=listingTypeWeight&cursor=bz03Njg%3D
where cursor is given by previoud search, cursors.next/previous
This is in div with id="js-dom-data-prefetched-data"
Looking for listing-id dc4dc139-f3a3-4375-875f-d1831506953e
prop licenses, array, find license with "name": "Professional" or "slug": "professional", and get its "offerId": "995b4f8437f4493bba976231b99f958b",
Then make post to https://www.fab.com/i/listings/a984aac1-d20f-4232-8ce8-212e1695aaf6/add-to-library
With Cookie, Referer, X-CsrfToken Header
@jo-chemla
jo-chemla / computeCrsTransform.js
Last active August 29, 2024 12:37
computeCrsTransform by transforming trihedron via proj4
const computeCrsTransform = (
sourceCrsOriginCoords,
sourceCrsProj,
targetCrsProj
) => {
let sourceCrsDefinition =
sourceCrsProj || "+proj=longlat +datum=WGS84 +no_defs";
const targetCrsDefinition =
targetCrsProj || "+proj=longlat +datum=WGS84 +no_defs";
@jo-chemla
jo-chemla / ffmpeg-360-equirect-cubemap-persp.sh
Created September 11, 2023 16:35
Ffmpeg commands using v360 filter to convert between equirectangular equirect cubemap persp etc
# ffmpeg combo: equirect-to-cubemap (standard 6 faces + yaw:45° 4 horiz faces)
ffmpeg -i input.mp4 -filter_complex [0:v]split=2[in1][in2];[in1]v360=equirect:c3x2:out_forder=frblud,untile=3x2[out1];[in2]v360=equirect:c6x1:out_forder=frblud:yaw=45,crop=4/6*in_w:in_h:0:0,untile=4x1[out2] -map [out1] cubemap2\cubemap_frblud_%05d.jpg -map [out2] cubemap2\cubemap_45_frbl_%05d.jpg
# from equirectangular to standard cubemap
ffmpeg -i input.mp4 -vf "v360=equirect:c3x2:out_forder=frblud,untile=3x2" cubemap\cubemap_frblud_%05d.jpg
# from equirectangular to standard yaw:45° cubemap (no top/bottom)
ffmpeg -i input.mp4 -filter_complex "v360=equirect:c6x1:out_forder=frblud:yaw=45,crop=4/6*in_w:in_h:0:0,untile=4x1" cubemap\cubemap_45_frbl_%05d.jpg
# from equirectangular to 90° rectilinear persp
ffmpeg -i input.mp4 -vf "v360=e:rectilinear:h_fov=90:v_fov=90" output.mp4
@jo-chemla
jo-chemla / kapture-cropper.py
Last active November 21, 2024 07:08
Quick utility to crop a kapture images and adapt intrinsics
# py kapture-cropper.py -i dataset-kapture\ --border_px 0 --scale_factor 1 -v
import kapture
import kapture.io.csv as csv
from PIL import Image
from kapture.io.csv import kapture_to_dir
import os, logging, argparse
import kapture.utils.logging
logger = logging.getLogger("kapture-cropper")