Skip to content

Commit

Permalink
webcam fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Abid committed Jul 21, 2020
1 parent bc7633e commit baa7ef3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
3 changes: 2 additions & 1 deletion build/lib/gradio/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def launch(self, inline=None, inbrowser=None, share=False, validate=True, debug=
config["examples"] = processed_examples

networking.set_config(config, output_directory)
networking.set_meta_tags(output_directory, self.title, self.description, self.thumbnail)

if debug:
while True:
Expand All @@ -411,7 +412,7 @@ def launch(self, inline=None, inbrowser=None, share=False, validate=True, debug=

@classmethod
def get_instances(cls):
return list(Interface.instances) #Returns list of all current instances
return list(Interface.instances) # Returns list of all current instances.


def reset_all():
Expand Down
6 changes: 4 additions & 2 deletions build/lib/gradio/static/js/interfaces/input/webcam.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ const webcam = {
Webcam.snap(function(image_data) {
io.io_master.input(io.id, image_data);
});
// Webcam.freeze();
Webcam.freeze();
this.target.find("video").hide();
this.state = "SNAPPED";
},
clear: function() {
if (this.state == "SNAPPED") {
this.state = "CAMERA_ON";
// Webcam.unfreeze();
Webcam.unfreeze();
this.target.find("video").show();
}
},
state: "NOT_STARTED",
Expand Down
11 changes: 11 additions & 0 deletions build/lib/gradio/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@

<!-- <iframe src=""></iframe> -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta property="og:url" content="https://gradio.app/" />
<meta property="og:type" content="website" />
<meta property="og:image" content="{{thumbnail}}" />
<meta property="og:title" content="{{title}}" />
<meta property="og:description" content="{{description}}" />
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@teamGradio">
<meta name="twitter:title" content="{{title}}">
<meta name="twitter:description" content="{{description}}">
<meta name="twitter:image" content="{{thumbnail}}">

<title>Gradio</title>
<!-- VENDOR -->
<link type="text/css" href="../static/css/vendor/tui-color-picker.css" rel="stylesheet">
Expand Down
6 changes: 4 additions & 2 deletions gradio/static/js/interfaces/input/webcam.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ const webcam = {
Webcam.snap(function(image_data) {
io.io_master.input(io.id, image_data);
});
// Webcam.freeze();
Webcam.freeze();
this.target.find("video").hide();
this.state = "SNAPPED";
},
clear: function() {
if (this.state == "SNAPPED") {
this.state = "CAMERA_ON";
// Webcam.unfreeze();
Webcam.unfreeze();
this.target.find("video").show();
}
},
state: "NOT_STARTED",
Expand Down

0 comments on commit baa7ef3

Please sign in to comment.