Cloud-CV / py-cloudcv

Python APIs for CloudCV
cloudcv.org
98 stars 55 forks source link

API Design - Reliance on config and directory structure #1

Closed FreakTheMighty closed 10 years ago

FreakTheMighty commented 10 years ago

I would suggest getting rid of the config.json file as well as reliance on directories full of images. It seems to me that the config file can simply be replaced by functional interface. Also, I don't think the arguments to those function should be directories. The API should not care where image data is retrieved from.

I think a more intuitive and generic API would look something like.

img1 = open("/path/to/file.jpg") img2 = open("/path/to/file2.jpg") c = PCloudCv() c.stitch(img1,img2, callback=onCompletion) c.detect(img1,callback=onCompletion)

Generally, what I am suggesting is that the API use functions, that take python object and return python objects.

Also you might consider looking at picloud, to see how their python API works with async jobs http://docs.picloud.com/primer.html#creating-a-job-from-python .

dexter1691 commented 10 years ago

Thanks for your suggestions, we are currently working on our second version of API and would consider incorporating your suggestions.