Skip to content

Commit

Permalink
Added confidence when in the NotifyResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander James Wallar committed Jan 20, 2014
1 parent 995ed43 commit ae70b5d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Locabean/src/com/locaudio/api/NotifyResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ public class NotifyResponse {

@SerializedName("name")
public String name;

@SerializedName("confidence")
public float confidence;
}
2 changes: 1 addition & 1 deletion locaudio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ def notify_event(self, data):

req = urllib2.Request(url=self.notify_url, data=encdata)
res = urllib2.urlopen(req)
return res.read()
return json.loads(res.read())


7 changes: 6 additions & 1 deletion locaudio/detectionserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ def post_notify():
request_to_detection_event(request.form, confidence)
)

return jsonify(error=0, message="No error", name=sound_name)
return jsonify(
error=0,
message="No error",
name=sound_name,
confidence=confidence
)


@config.app.route("/locations/<sound_name>", methods=["GET"])
Expand Down

0 comments on commit ae70b5d

Please sign in to comment.