Skip to content

Instantly share code, notes, and snippets.

@cpaltrinieri
Forked from leoimpett/ExampleDataFile.csv
Created April 2, 2020 08:32
Show Gist options
  • Save cpaltrinieri/2eaa172e12627a4e0e8f98351bb95390 to your computer and use it in GitHub Desktop.
Save cpaltrinieri/2eaa172e12627a4e0e8f98351bb95390 to your computer and use it in GitHub Desktop.
Autogenerated from www.imagegraph.cc, dario-test
{"caption":" dario-test","offset":{"x":-109,"y":-441},"nodes":{"603a584e-2b10-46e1-9001-fbabac81aa20":{"id":"603a584e-2b10-46e1-9001-fbabac81aa20","position":{"x":717,"y":569},"type":"loadIIIFManifest","ports":{"port1":{"id":"port1","type":"bottom","properties":{"type":"imL"},"position":{"x":93,"y":79}}},"properties":{"text":"Loads a IIIF manifest. Paste in any IIIF manifest URL, which you can get from most libraries. ","form":"string","innerValue":"https://purl.stanford.edu/jr903ng8662/iiif/manifest"}},"1cd36c08-6b45-463c-888f-7c07691ac2bc":{"id":"1cd36c08-6b45-463c-888f-7c07691ac2bc","position":{"x":683,"y":483},"type":"comment","ports":{},"properties":{"text":"Does nothing; just a comment! ","form":"string","innerValue":"A manuscript"}},"96da27ea-be70-436c-8cda-7f870809b16f":{"id":"96da27ea-be70-436c-8cda-7f870809b16f","position":{"x":1058,"y":572},"type":"loadIIIFManifest","ports":{"port1":{"id":"port1","type":"bottom","properties":{"type":"imL"},"position":{"x":93,"y":79}}},"properties":{"text":"Loads a IIIF manifest. Paste in any IIIF manifest URL, which you can get from most libraries. ","form":"string","innerValue":"https://media.nga.gov/public/manifests/nga_highlights.json"}},"413f385b-61e8-4c0d-b3da-6c82a8d7220b":{"id":"413f385b-61e8-4c0d-b3da-6c82a8d7220b","position":{"x":1034,"y":492},"type":"comment","ports":{},"properties":{"text":"Does nothing; just a comment! ","form":"string","innerValue":"some paintings"}},"8eeb1269-e649-4b0d-ad24-6944e742fdce":{"id":"8eeb1269-e649-4b0d-ad24-6944e742fdce","position":{"x":795,"y":722},"type":"getNNEmbedding","ports":{"port1":{"id":"port1","type":"top","properties":{"type":"imL"},"position":{"x":53,"y":0}},"port2":{"id":"port2","type":"bottom","properties":{"type":"vL"},"position":{"x":53,"y":44}}},"properties":{"text":"Extracts the second-to-last-layer neural network embedding for each image fed in; outputs them as a list of vectors","form":"none"}},"37415170-eb8a-4465-99d9-3a5050793d84":{"id":"37415170-eb8a-4465-99d9-3a5050793d84","position":{"x":1063,"y":741},"type":"getNNEmbedding","ports":{"port1":{"id":"port1","type":"top","properties":{"type":"imL"},"position":{"x":53,"y":0}},"port2":{"id":"port2","type":"bottom","properties":{"type":"vL"},"position":{"x":53,"y":44}}},"properties":{"text":"Extracts the second-to-last-layer neural network embedding for each image fed in; outputs them as a list of vectors","form":"none"}},"11d21c51-3fde-4c53-af03-f40e1ec3daef":{"id":"11d21c51-3fde-4c53-af03-f40e1ec3daef","position":{"x":928,"y":896},"type":"trainClassifier","ports":{"port1":{"id":"port1","type":"top","properties":{"type":"vL"},"position":{"x":39,"y":0}},"port2":{"id":"port2","type":"top","properties":{"type":"vL"},"position":{"x":75,"y":0}},"port3":{"id":"port3","type":"bottom","properties":{"type":"C"},"position":{"x":57,"y":44}}},"properties":{"text":"Train an SVM to differentiate between the two lists of vectors. ","form":"none"}},"3caa17d3-1e94-47b4-8c5c-4f896e5b6014":{"id":"3caa17d3-1e94-47b4-8c5c-4f896e5b6014","position":{"x":706,"y":1311},"type":"applyClassifier","ports":{"port1":{"id":"port1","type":"top","properties":{"type":"imL"},"position":{"x":21,"y":0}},"port2":{"id":"port2","type":"top","properties":{"type":"vL"},"position":{"x":57,"y":0}},"port3":{"id":"port3","type":"top","properties":{"type":"C"},"position":{"x":93,"y":0}},"port4":{"id":"port4","type":"bottom","properties":{"type":"imL"},"position":{"x":39,"y":44}},"port5":{"id":"port5","type":"bottom","properties":{"type":"imL"},"position":{"x":75,"y":44}}},"properties":{"text":"Classify image list using an SVM on the vector list input. ","form":"none"}},"5766d245-0987-40b7-b5cd-fa615d5dc9f4":{"id":"5766d245-0987-40b7-b5cd-fa615d5dc9f4","position":{"x":611,"y":970},"type":"loadIIIFManifest","ports":{"port1":{"id":"port1","type":"bottom","properties":{"type":"imL"},"position":{"x":93,"y":79}}},"properties":{"text":"Loads a IIIF manifest. Paste in any IIIF manifest URL, which you can get from most libraries. ","form":"string","innerValue":"https://iiif.harvardartmuseums.org/manifests/object/299843"}},"5335ca93-6406-4f98-9a36-2921ccb7916d":{"id":"5335ca93-6406-4f98-9a36-2921ccb7916d","position":{"x":585,"y":896},"type":"comment","ports":{},"properties":{"text":"Does nothing; just a comment! ","form":"string","innerValue":"a painting by V G"}},"83f0fd6f-041f-435e-a51b-e804a6ab611d":{"id":"83f0fd6f-041f-435e-a51b-e804a6ab611d","position":{"x":722,"y":1097},"type":"getNNEmbedding","ports":{"port1":{"id":"port1","type":"top","properties":{"type":"imL"},"position":{"x":53,"y":0}},"port2":{"id":"port2","type":"bottom","properties":{"type":"vL"},"position":{"x":53,"y":44}}},"properties":{"text":"Extracts the second-to-last-layer neural network embedding for each image fed in; outputs them as a list of vectors","form":"none"}},"f7e22f27-e1ee-44b4-902e-e69ae36d40f9":{"id":"f7e22f27-e1ee-44b4-902e-e69ae36d40f9","position":{"x":713,"y":1450},"type":"showTwoImageSets","ports":{"port1":{"id":"port1","type":"top","properties":{"type":"imL"},"position":{"x":43,"y":0}},"port2":{"id":"port2","type":"top","properties":{"type":"imL"},"position":{"x":79,"y":0}}},"properties":{"text":"Show (and compare) a pair of images. ","form":"none"}}},"selected":{},"links":{"61a3835d-a860-4cab-90c6-8cfe29aaec34":{"id":"61a3835d-a860-4cab-90c6-8cfe29aaec34","from":{"nodeId":"96da27ea-be70-436c-8cda-7f870809b16f","portId":"port1"},"to":{"nodeId":"37415170-eb8a-4465-99d9-3a5050793d84","portId":"port1"}},"a6711c7c-1f8f-41c5-a4f1-8cdfaeda3ec1":{"id":"a6711c7c-1f8f-41c5-a4f1-8cdfaeda3ec1","from":{"nodeId":"603a584e-2b10-46e1-9001-fbabac81aa20","portId":"port1"},"to":{"nodeId":"8eeb1269-e649-4b0d-ad24-6944e742fdce","portId":"port1"}},"cd0b1627-74a7-43d3-8007-27eb86df6a77":{"id":"cd0b1627-74a7-43d3-8007-27eb86df6a77","from":{"nodeId":"8eeb1269-e649-4b0d-ad24-6944e742fdce","portId":"port2"},"to":{"nodeId":"11d21c51-3fde-4c53-af03-f40e1ec3daef","portId":"port1"}},"2f70b03b-71c2-4137-a16a-81b319909bb9":{"id":"2f70b03b-71c2-4137-a16a-81b319909bb9","from":{"nodeId":"37415170-eb8a-4465-99d9-3a5050793d84","portId":"port2"},"to":{"nodeId":"11d21c51-3fde-4c53-af03-f40e1ec3daef","portId":"port2"}},"930bcd7b-13d6-492e-b9fd-d9a621c9d852":{"id":"930bcd7b-13d6-492e-b9fd-d9a621c9d852","from":{"nodeId":"11d21c51-3fde-4c53-af03-f40e1ec3daef","portId":"port3"},"to":{"nodeId":"3caa17d3-1e94-47b4-8c5c-4f896e5b6014","portId":"port3"}},"45f8a80b-2d79-41c7-9670-37b3495865d3":{"id":"45f8a80b-2d79-41c7-9670-37b3495865d3","from":{"nodeId":"5766d245-0987-40b7-b5cd-fa615d5dc9f4","portId":"port1"},"to":{}},"b4a41905-98a0-4213-bc74-e88d762f52a4":{"id":"b4a41905-98a0-4213-bc74-e88d762f52a4","from":{"nodeId":"5766d245-0987-40b7-b5cd-fa615d5dc9f4","portId":"port1"},"to":{"nodeId":"83f0fd6f-041f-435e-a51b-e804a6ab611d","portId":"port1"}},"544768d8-0a81-40f9-8db7-a14136773145":{"id":"544768d8-0a81-40f9-8db7-a14136773145","from":{"nodeId":"83f0fd6f-041f-435e-a51b-e804a6ab611d","portId":"port2"},"to":{"nodeId":"3caa17d3-1e94-47b4-8c5c-4f896e5b6014","portId":"port2"}},"6596a47e-9d89-4620-86f7-fb0292a4c5d4":{"id":"6596a47e-9d89-4620-86f7-fb0292a4c5d4","from":{"nodeId":"5766d245-0987-40b7-b5cd-fa615d5dc9f4","portId":"port1"},"to":{"nodeId":"3caa17d3-1e94-47b4-8c5c-4f896e5b6014","portId":"port1"}},"36c38262-8727-4938-a3ec-d927e33acb2b":{"id":"36c38262-8727-4938-a3ec-d927e33acb2b","from":{"nodeId":"3caa17d3-1e94-47b4-8c5c-4f896e5b6014","portId":"port4"},"to":{"nodeId":"f7e22f27-e1ee-44b4-902e-e69ae36d40f9","portId":"port1"}},"87129aed-0277-42aa-a508-83eefa800f9c":{"id":"87129aed-0277-42aa-a508-83eefa800f9c","from":{"nodeId":"3caa17d3-1e94-47b4-8c5c-4f896e5b6014","portId":"port5"},"to":{"nodeId":"f7e22f27-e1ee-44b4-902e-e69ae36d40f9","portId":"port2"}}},"hovered":{}}
Display the source blob
Display the rendered blob
Raw
{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "ImageGraph.ipynb", "version": "0.3.2", "provenance": [], "collapsed_sections": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "code", "metadata": { "id": "gsUbIGfNqSjV", "colab_type": "code", "colab": { "base_uri": "https://localhost:8080/", "height": 34 }, "outputId": "a306f9c8-c721-4280-fba4-f175cffa7090" }, "source": [ " # Remember to install the imagegraph Python library thus:\n!pip install git+https:\/\/github.com\/leoimpett\/pyimagegraph\nimport imagegraph as ig\nimL00 = ig.loadIIIFManifest(\"https:\/\/purl.stanford.edu\/jr903ng8662\/iiif\/manifest\") \n_ = ig.comment(\"A manuscript\") \nimL01 = ig.loadIIIFManifest(\"https:\/\/media.nga.gov\/public\/manifests\/nga_highlights.json\") \n_ = ig.comment(\"some paintings\") \nvL02 = ig.getNNEmbedding(imL00) \nvL03 = ig.getNNEmbedding(imL01) \nC04 = ig.trainClassifier(vL02,vL03) \nimL07 = ig.loadIIIFManifest(\"https:\/\/iiif.harvardartmuseums.org\/manifests\/object\/299843\") \n_ = ig.comment(\"a painting by V G\") \nvL08 = ig.getNNEmbedding(imL07) \nimL05,imL06 = ig.applyClassifier(imL07,vL08,C04) \n_ = ig.showTwoImageSets(imL05,imL06) " ], "execution_count": 0, "outputs": [ { "output_type": "stream", "text": [ " " ], "name": "stdout" } ] } ]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment