mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-13 11:57:29 +08:00
webcam fix
This commit is contained in:
parent
bc7633ebf4
commit
baa7ef3cf2
@ -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():
|
||||
|
@ -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",
|
||||
|
@ -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">
|
||||
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user