-
Notifications
You must be signed in to change notification settings - Fork 19
Home
See donkey/BUILD for instruction.
The server reads configuration from an XML file named donkey.xml by default. The configure path can be changed via commandline. Modify the following for QBIC demo.
<donkey>
<max_dbs>1</max_dbs>
<root>db</root>
<defaults>
<K>200</K>
<R>2</R>
<hint_K>250</hint_K>
<hint_R>2</hint_R>
</defaults>
<lsh><tables>1</tables><bits>10</bits><allocate>67108864</allocate></lsh>
<thrift>
<server><port>38082</port></server>
<client><port>38082</port></client>
</thrift>
</donkey>
Note that donkey.thrift.server.port is the port the server uses. We'll use the same config file for client, which will connect to the port donkey.thrift.client.port (of localhost).
Create a directory named "db", and run the server program in the same directory.
Prepare an input list file, which should be a 3-column text file separated by tab, each line containing the information of one image, like the following:
18 /scratch/demo/qbic/static/image/02/0/TB1l5.RHpXXXXaDXpXXXXXXXXXX_!!0-item_pic.jpg {"thumb": "static/thumb/02/0/TB1l5.RHpXXXXaDXpXXXXXXXXXX_!!0-item_pic.jpg", "title": "\u827e\u683c ES U1 \u8170\u95f4\u7cfb\u5e26\u5bbd\u677e\u725b\u4ed4\u88e415032305941\u540a\u724c\u4ef7199\u5143"}
First column: image ID, a string. Second column: absolute image path. Third column: a json with a "thumb" field.
Notes: Donkey treats first and third column are arbitrary strings. Currently the client use tab as delimiter, so tab should not appear in those strings. However, if the thrift API is used, it's OK to have tabs in the strings.
Run client to import images (at the same directory where donkey.xml is).
$ client insert < LIST_FILE_CREATED ABOVE
Verify that the server is running:
$ echo "1 some_path_to_image.jpg" | client search
It should return some results.
Run the nodejs server in the directory donkey/demo/qbic-node. This will start the demo page at port 38081.