Skip to content

ds2ai.Util

class Util(object)

This is a class for handling process of making predictions in DS2.ai's consol according to the file format, such as csv, jpg, png, mov, and etc.

predict()

Calls self._predict() with different parameters according to the format of the file.

predict(request_data, predict_url, data, info=False)
  • Parmeters:
    • request_data (dict) : stores all the information for making requests for the current prediction
    • predict_url (str): a specific url as a string as a parameter for calling self._predict()
    • data (dict, string, file): target for prediction, can take multiple formats
  • Return type:
    • requests

_predict()

Returns information on req.post depending on file_content.

_predict(target_url, request_data, file_content=None)
  • Parmeters:
    • target_url (str) : name of the label class
    • request_data (str): stores all the information for making requests for the current prediction and is the same content as request_data in self.predict()
    • file_content (str): gets file content from self.predict() for prediction
  • Return type: -