File size: 1,023 Bytes
6bea3f9
 
 
 
 
 
 
 
 
0839c2d
 
 
6bea3f9
636cb49
0874378
636cb49
 
 
df02a37
 
 
6bea3f9
3b6db54
df02a37
 
 
 
 
 
 
 
 
 
 
6bea3f9
3b6db54
 
6bea3f9
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import gradio as gr
import gc
import cv2
import torch
import torch.nn.functional as F
from tqdm import tqdm
from transformers import DistilBertTokenizer
import matplotlib.pyplot as plt
from implement import *
# import config as CFG
# from main import build_loaders
# from CLIP import CLIPModel
import os
import zipfile

# Define the filename
zip_filename = 'Images.zip'

import os
import zipfile

with gr.Blocks(css="style.css") as demo:
# Define the filename
        zip_filename = 'Images.zip'
        
        # Check if the file exists
        if os.path.isfile(zip_filename):
            # Open the zip file
            with zipfile.ZipFile(zip_filename, 'r') as zip_ref:
                # Extract all contents of the zip file to the current directory
                zip_ref.extractall()
            print(f"'{zip_filename}' has been successfully unzipped.")
        else:
            print(f"'{zip_filename}' not found in the current directory.")
    

   
    
    # Create Gradio interface
demo.launch(share=True)