import gradio as gr import os print('Get current working directory : ', os.getcwd()) path=os.getcwd() path=os.getcwd()+"clipseg/" import git from pathlib import Path print('working path', Path.cwd()) git.Git(path).clone("https://github.com/ThereforeGames/txt2mask.git") from zipfile import ZipFile #zf = ZipFile('clipseg-master.zip', 'r') #zf.extractall('clipseg/') #zf.close() from zipfile import ZipFile ZipFile("clipseg-master.zip").extractall("clipseg/") import zipfile def un_zipFiles(path): files=os.listdir(path) for file in files: if file.endswith('.zip'): filePath=path+'/'+file zip_file = zipfile.ZipFile(filePath) for names in zip_file.namelist(): zip_file.extract(names,path) zip_file.close() #download_and_extract_zip_file() #clone_github_repository() #with gr.Blocks() as demo: #demo.launch() #import time #import git #git.Git("clipseg/").clone("https://github.com/ThereforeGames/txt2mask.git") #from git import RemoteProgress #class CloneProgress(RemoteProgress): # def update(self, op_code, cur_count, max_count=None, message=''): # if message: # print(message) #git_root='home/user/app/clipseg1' #print('Cloning into %s' % git_root) #git.Repo.clone_from('https://github.com/ThereforeGames/txt2mask.git', git_root, # branch='master', progress=CloneProgress()) #------------- #import sys #import os #path = "home/user/app/clipseg" #clone = "git clone https://github.com/ThereforeGames/txt2mask.git" #os.system("sshpass -p your_password ssh user_name@your_localhost") #os.chdir(path) # Specifying the path where the cloned project needs to be copied #os.system(clone) # Cloning