Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test commit * overload classify function with coreml version. hit standard VR endpoint on callback * iterate coreml results on callback * convert coreml output into vision SDK model format * filter coreml results by confidence. return immediately if valid results * don't do coreml request on background thread * add debug line... * cleaned up printing, return more responses * convert coreml classify function to accept image as NSData * run classification on background thread to be non-blocking * test passing to sdk as NSdata * test * classify function for NSData by writing to temp file... giving up on proper implementation for now * short-circuit coreml call if localthresh min is set to 1.0 * moving model abstraction into sdk * Completion handler for getLatest method * moved coreml functions to extension of VR class * switch from passing image as NSData to Data * fix: JSON -> JSONWrapper * point at bluemix server for model pull. this is only temporary until coreml functionality is moved to VR server. this requires keys to be placed at Source/VisualRecognitionV3/Credentials.swift * pass api key via method * update getClassifiers with and updated classifier data model * updated createClassifier with core_ml_enabled * fixed some indentation * more indentation * typos and refactored core_ml_enabled and core_ml_status to camelCase * change core_ml_enabled to coreMLEnabled * updated updateClassifier with coreMLEnabled * coreMLEnalbed: Bool? = nil * coreMLEnalbed: Bool? = nil * coreMLEnabled defaults to nil, check param before adding * check if coreMLEnabled has value, stringify bool * check if coreMLEnabled has value, stringify bool * removed tab * add space * downloadClassifier modeled after downloading configuration in R&R * revised endpoint for downloadClassifier * update documentation annotation * unwrap hybrid classify function * decompose model abstraction class. store models by classifier id. first versions of updateCoreMLModelLocally and getCoreMLModelLocally * store models in application support directory * success and failure for callbacks to updateLocalCoreMLModel * handle requests to multiple local classifiers. something wrong around variable scoping and callback closures * moved downloadClassifier to VR extension, changes from pairing with Glenn * explicitly classify on different threads. VNImageRequestHandler was not behaving for multiple requests. this fixes the issue noted in the last commit. also using a dispatch group now * return MLModel from getCoreMLModeLocally * parse metadata from model for classifier ID and name * nicer formatting for unwrapping metadata dict * exclude saved model file from backup * changes from glenn's pr review * Construct compiledModelURL before it is referenced * Combine do-try-catch blocks for readability * Use NSLocalizedDescriptionKey instead of NSLocalizedFailureReasonErrorKey * Check if compiled model exists before removing it * add downloadClassifier * orig cleanup * Extend availability tag for multiple platforms * Change image type to UIImage * Update style * revise updateCoreMLModelLocally to check for new classifier and call download * Change `results` type to an array to avoid hashing * Fix errors with JSON representation of results * Use modelURL.path instead of modelURL.absoluteString * getCoreMLModelLocally, updateCoreMLModelLocally and downloadClassifier all return URL * WIP - listCoreMLModels, changed dateformatter * throw error in listCoreMLmodels, implement deleteCoreMLModel, write getApplicationSupportDirectory * pairing with Glenn on listCoreMLModels and deleteCoreMLModel * Add getCoreMLModel * Set the url for testing * Fix string interpolation value * Return MLModel directly instead of URL * Check the classifier’s core ml status when using preferRemote policy A newer version of the model is available when (1) the classifier has a newer updated date and (2) the classifier’s core ml status is “ready”. If the classifier has been updated with new training data but the core ml model is still being trained, then the preferRemote policy will use the local model. * Use test server for getClassifier * update ReadMe with Core ML Exampeles * Use classifier id when contacting test server * Use a separate api key for the test server * Download a classifier if the model’s metadata cannot be read * change header from public api to core ML, regeregeneratte documentation * move core ml readme above links * hotfix: hit failure function on all error returns * refactor from discussed changes * orig cleanup * orig cleanup * revise header from Public API to Core ML * regenerate documentation * regenerate documentation * revise method in readme according to sdk changes * Filter observations with user-provided threshold value * Add comments * Simplify the execution of each classification request * Revert "Simplify the execution of each classification request" This reverts commit 4377b70. * Update comments for test server networking * Fix url for test server * Run convert and success with userInitiated qos * Move scope of defer statement * Create downloads directory if it doesn’t exist * Use explicit date formatter with milliseconds * regenerate documentation * Break up sentance in readme * Create application support directory if it does not already exist * Specify that model files are not directories * Use replaceItemAt when the compiled model already exists * revised examples * rephrased Using Core ML description * Change interface for getLocalModel * Add tests for VisualRecognition+CoreML * regenerate documentation * rename VisualRecognitionCoreML.swift to VisualRecognition+CoreML.swift * Do not require the application support directory to exist * Simplify model lookup in main bundle * Construct strings with error.localizedDescription * Improve comments * Avoid silencing errors that are thrown * resolving merge conflicts * leave dispatch group on failure to execute classification request * Use https instead of http * getting last updated date, adding retrained to the classifier model * misspelling, nullable retrained in datamodel, ?? operator to get date * remove core_ml_status from classifier model - use status * remove core_ml_enabled query param * revise documentation for GET/classifiers/{cid} to include IBM Model ID * add owners query param to getClassifiers operation * parse local model updated date from created & retrained * remove updated field from Classifier data model * create temporary directory for mlmodel download instead of using Documents directory * regenerate documentationgit status * refactored out temporary service * adding missing query params in download core ml model and get classifier, remove coreMLEnabled from classifier * indentation * add in commented out coreMLEnabled field to be uncommented when it is available in the response * change acceptType of DownloadClassifier to application/octet-stream, uncomment coreMlEnabled in model and made nullable * changing readme ios-sdk references to swift-sdk (mostly in URLs) per legal request * Make properties internal instead of private * Update CoreML extension for updated API * Disable function_body_length rule for downloadClassifier * Update tests for latest Visual Recognition API * Update style to conform to SwiftLint * Create an internal JSON string instead of a dictionary * Remove extraneous test now that the service is live * update readme to include separate classify and update instructions, getLocalModel and deleteLocalModel * implement Glenn's suggestions * missing 'when' * add Devin's readme changes * update readme with glenns suggestion * devin's suggestions * Regenerate swift-api documentation * revise list models method to check if application support directory exists.
- Loading branch information