webcam fix

This commit is contained in:
Ali Abid 2020-07-21 07:53:57 -07:00
parent bc7633ebf4
commit baa7ef3cf2
4 changed files with 21 additions and 5 deletions

View File

@ -389,6 +389,7 @@ class Interface:
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:
@ -411,7 +412,7 @@ class Interface:
@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():

View File

@ -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",

View File

@ -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">

View File

@ -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",