Rafael Goncalves avatar Rafael Goncalves committed 67ae5a5

Remove files.

Comments (0)

Files changed (2)


-# /usr/bin/env python
-# -*- coding: utf-8 -*-
-import mimetypes
-import visionds_client
-import tempfile
-import sys
-import argparse
-import cv
-import pprint
-import json
-import StringIO
-parser = argparse.ArgumentParser(description='Vision daset client demo ',
-                                epilog='''
-Extracts features (surf) from an image file stored in VisionDataset and
-saves the result as an attachment''')
-parser.add_argument('--image_uri','-u', help='Imge URI given by Vision DataSet system', required=True)
-parser.add_argument('--attachment_name', '-a', help='Attachment name to be saved at\
-        VisionDataset', nargs='?', default='features.json')
-env = parser.parse_args()
-image_buffer, mime_type = visionds_client.get_image(imageuri)
-extension = mimetypes.guess_extension(mime_type)
-tmp = tempfile.NamedTemporaryFile(suffix=extension)
-img = cv.LoadImage(tmp.name, cv.CV_LOAD_IMAGE_GRAYSCALE)
-keypoints, descriptors = cv.ExtractSURF(img, None, cv.CreateMemStorage(), (0, 400, 3, 1))
-points = []
-for ((x, y), laplacian, size, dir, hessian) in keypoints:
-    points.append({
-        'x':x,
-        'y':y,
-        'laplacian':laplacian,
-        'hessian':hessian,
-        'size': size})
-out = StringIO.StringIO(json.dumps(points))
-out.name = env.attachment_name
-attachment = visionds_client.create_attachment(imageuri, env.attachment_name)
Add a comment to this file


Binary file removed.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.