Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
# See the License for the specific language governing permissions and
|
14 |
# limitations under the License.
|
15 |
-
|
16 |
import tempfile
|
17 |
from PIL import Image
|
18 |
import subprocess
|
@@ -95,6 +95,7 @@ def crop_face_img(image):
|
|
95 |
face = image.crop(face_bbox)
|
96 |
return face
|
97 |
|
|
|
98 |
def vlm_img_caption(image):
|
99 |
if isinstance(image, str):
|
100 |
image = Image.open(image).convert("RGB")
|
@@ -150,6 +151,7 @@ def open_accordion_on_example_selection(*args):
|
|
150 |
print(outputs)
|
151 |
return outputs
|
152 |
|
|
|
153 |
def generate_image(
|
154 |
prompt,
|
155 |
cond_size, target_height, target_width,
|
|
|
12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
# See the License for the specific language governing permissions and
|
14 |
# limitations under the License.
|
15 |
+
import spaces
|
16 |
import tempfile
|
17 |
from PIL import Image
|
18 |
import subprocess
|
|
|
95 |
face = image.crop(face_bbox)
|
96 |
return face
|
97 |
|
98 |
+
@spaces.GPU()
|
99 |
def vlm_img_caption(image):
|
100 |
if isinstance(image, str):
|
101 |
image = Image.open(image).convert("RGB")
|
|
|
151 |
print(outputs)
|
152 |
return outputs
|
153 |
|
154 |
+
@spaces.GPU()
|
155 |
def generate_image(
|
156 |
prompt,
|
157 |
cond_size, target_height, target_width,
|