Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Pastec notes is an OSS feature recognition project that provides an http interface to train and search for matches.

Setup on a Mac

Get pastec:

$ git clone && cd pastec

Get dependencies:

$ brew install homebrew/science/opencv jsoncpp libmicrohttpd


$ mkdir build && cmake ../ && make

Get "visual words" datafile:

$ curl | tar xvz


$ ./pastec -p 4242 visualWordsORB.dat

Add an image:

$ curl -X PUT --data-binary @/path/to/img.jpg http://localhost:4242/index/images/23

   "image_id" : 23,
   "type" : "IMAGE_ADDED"

Remove an image:

$ curl -X DELETE http://localhost:4242/index/images/23

   "image_id" : 23,
   "type" : "IMAGE_REMOVED"


$ curl -X POST --data-binary @/home/test/img/request.jpg http://localhost:4242/index/searcher


Save index:

curl -X POST -d '{"type":"WRITE", "index_path":"training-index.dat"}' http://localhost:4242/index/io

   "type" : "INDEX_WRITTEN"

Load index:

curl -X POST -d '{"type":"LOAD", "index_path":"training-index.dat"}' http://localhost:4242/index/io

   "type" : "INDEX_LOADED"

Clear index:

$ curl -X POST -d '{"type":"CLEAR"}' http://localhost:4242/index/io



  • interactions are all over http, downstream of user-facing app
  • web app needs to assign indexes & prevent id collisions


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment