{"action":"created","issue":{"url":"https://api.github.com/repos/apple/turicreate/issues/798","repository_url":"https://api.github.com/repos/apple/turicreate","labels_url":"https://api.github.com/repos/apple/turicreate/issues/798/labels{/name}","comments_url":"https://api.github.com/repos/apple/turicreate/issues/798/comments","events_url":"https://api.github.com/repos/apple/turicreate/issues/798/events","html_url":"https://github.com/apple/turicreate/issues/798","id":337314168,"node_id":"MDU6SXNzdWUzMzczMTQxNjg=","number":798,"title":"Change optional inputs of object detection model in Xcode","user":{"login":"borderlineinteractive","id":25187079,"node_id":"MDQ6VXNlcjI1MTg3MDc5","avatar_url":"https://avatars3.githubusercontent.com/u/25187079?v=4","gravatar_id":"","url":"https://api.github.com/users/borderlineinteractive","html_url":"https://github.com/borderlineinteractive","followers_url":"https://api.github.com/users/borderlineinteractive/followers","following_url":"https://api.github.com/users/borderlineinteractive/following{/other_user}","gists_url":"https://api.github.com/users/borderlineinteractive/gists{/gist_id}","starred_url":"https://api.github.com/users/borderlineinteractive/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borderlineinteractive/subscriptions","organizations_url":"https://api.github.com/users/borderlineinteractive/orgs","repos_url":"https://api.github.com/users/borderlineinteractive/repos","events_url":"https://api.github.com/users/borderlineinteractive/events{/privacy}","received_events_url":"https://api.github.com/users/borderlineinteractive/received_events","type":"User","site_admin":false},"labels":[{"id":775278782,"node_id":"MDU6TGFiZWw3NzUyNzg3ODI=","url":"https://api.github.com/repos/apple/turicreate/labels/docs","name":"docs","color":"edb423","default":false},{"id":962930602,"node_id":"MDU6TGFiZWw5NjI5MzA2MDI=","url":"https://api.github.com/repos/apple/turicreate/labels/object%20detection","name":"object detection","color":"bf251a","default":false},{"id":766077336,"node_id":"MDU6TGFiZWw3NjYwNzczMzY=","url":"https://api.github.com/repos/apple/turicreate/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-01T19:10:12Z","updated_at":"2018-07-23T18:59:22Z","closed_at":null,"author_association":"NONE","body":"I cannot find documentation how to change the iouThreshold and confidenceThreshold Inputs for a Object Detection model generated with Turi Create 5.0b. Is there any information available on this topic?\r\n\r\nWhat I tried so far is something along these lines:\r\n\r\n```\r\nlet mlModel = object_detection().model\r\nlet visionModel = try VNCoreMLModel(for: mlModel)\r\nlet objectRecognition = VNCoreMLRequest(model: visionModel, completionHandler: output_handler_object_detection)\r\n\r\nlet requestOptions:[VNImageOption: Any] = [VNImageOption(rawValue: \"confidenceThreshold\"):0.1]\r\nlet ciImage = CIImage(cgImage: temp_img!)\r\nlet handler_features = VNImageRequestHandler(ciImage: inputImage!, options: requestOptions)\r\n\r\n do {\r\n  try handler_features.perform([objectRecognition])\r\n} catch {\r\n  print(error.localizedDescription)\r\n}\r\n```\r\nHowever, I do not see any change in the results. using VNImageOption was just a guess, and I do not get any error messages, regardless which rawValue I use.\r\n\r\nAny help or info would be appreciated.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/apple/turicreate/issues/comments/407165299","html_url":"https://github.com/apple/turicreate/issues/798#issuecomment-407165299","issue_url":"https://api.github.com/repos/apple/turicreate/issues/798","id":407165299,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzE2NTI5OQ==","user":{"login":"gustavla","id":902935,"node_id":"MDQ6VXNlcjkwMjkzNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/902935?v=4","gravatar_id":"","url":"https://api.github.com/users/gustavla","html_url":"https://github.com/gustavla","followers_url":"https://api.github.com/users/gustavla/followers","following_url":"https://api.github.com/users/gustavla/following{/other_user}","gists_url":"https://api.github.com/users/gustavla/gists{/gist_id}","starred_url":"https://api.github.com/users/gustavla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustavla/subscriptions","organizations_url":"https://api.github.com/users/gustavla/orgs","repos_url":"https://api.github.com/users/gustavla/repos","events_url":"https://api.github.com/users/gustavla/events{/privacy}","received_events_url":"https://api.github.com/users/gustavla/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T18:59:22Z","updated_at":"2018-07-23T18:59:22Z","author_association":"COLLABORATOR","body":"@borderlineinteractive The current source code (which I think should be available in the latest 5.0b2 beta version), the function `export_coreml` takes optional arguments `iou_threshold` and `confidence_threshold`, where you can change the default values that go into the mlmodel file.\r\n\r\nI agree that it is annoying to have to change all the prediction code to override these at runtime. We are definitely hoping to address this in the future. Sorry for the inconvenience!\r\n\r\nBy the way, more generally, the best way to open up an mlmodel and modify it is to use `coremltools`. Although, just a warning, this is not always trivial and can involve calling `get_spec()` on the MLModel and manually go through the protobuf object to change things. This can be tricky, but not as tricky as manually hacking the binary code. Hope that helps!\r\n\r\n"}}
{"actor":{"display_login":"gustavla"}}