Skip to content

Instantly share code, notes, and snippets.

import kfp
c = kfp.Client(host="...")
xs = c.experiments.list_experiment(page_size=200).experiments
for x in xs:
if (x.name.startswith('firstgraphidpipe') or x.name.startswith('secondgraphidpipe')) and not x.name.endswith('-us'):
print(x.id+x.name)
c.delete_experiment(x.id)
@vpipkt
vpipkt / asset_metadata.py
Created December 11, 2020 16:59
labelbox asset metadata
from labelbox import Client, DataRow
ds = Client().get_dataset('ckije80bs2l8m0yag5qc03doo')
drs = ds.data_rows()
dr = next(iter(drs)) # only one datarow in this dataset for now
dr.metadata() # this is a PaginatedCollection. To get the first element
next(iter(dr.metadata()))
@vpipkt
vpipkt / get_seg_masks.py
Last active November 17, 2020 20:58
get a bunch of segmentation masks from labelbox
import labelbox
import numpy as np
import PIL
import requests
from tqdm import tqdm
from retry import retry
from typing import *
import io

Moved 🚚

Moved from this Gist to a repo here

@vpipkt
vpipkt / genius.py
Created April 23, 2020 19:46
solution to tricksy picture algebra problem
# solution to https://files.slack.com/files-pri/T24GA6QHY-F0127L8RSUE/image_from_ios.jpg
import numpy
# index as cateprillar, clock and flower
# caterpillars data are # body segments
# clocks data are hour on the face of clock
# flower data are count of flowers, incl flowers on caterpillars' heads
a = numpy.array([
[5+5+5, 0, 3],
@vpipkt
vpipkt / folium-slippy.ipynb
Created July 13, 2018 19:16
export a rasterframe to slippy map tiles and view in notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vpipkt
vpipkt / geojson.ipynb
Created May 24, 2018 15:31
GeoJSON schema inference with RasterFrames
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vpipkt
vpipkt / example.ipynb
Created May 22, 2018 15:38
cluster and example operations in pyspark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
public static Geometry getGeodeticLineBuf(Geometry inline, int dist) {
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null );
GeodeticCalculator calc = new GeodeticCalculator(DefaultGeographicCRS.WGS84);
Coordinate[] subsat_points = inline.getCoordinates();
ArrayList<Coordinate> hull_right = new ArrayList<Coordinate>();
ArrayList<Coordinate> hull_left = new ArrayList<Coordinate>();
for (int i = 0; i < subsat_points.length-1; i++) {
calc.setStartingGeographicPoint(subsat_points[i].x,subsat_points[i].y);
import java.time._
import org.joda.time._
val j8 = ZonedDateTime.now(ZoneId.of("Z"))
//j8: java.time.ZonedDateTime = 2017-06-01T19:40:54.933Z
val z = DateTimeZone.forOffsetMillis(j8.getOffset.getTotalSeconds * 1000)
//z: org.joda.time.DateTimeZone = UTC
val jodated = new DateTime(j8.toInstant().toEpochMilli(), z)