Spaces:
Runtime error
Runtime error
Update app_t.py
Browse files
app_t.py
CHANGED
|
@@ -1,33 +1,41 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
from pathlib import Path
|
| 10 |
-
print('working path', Path.cwd())
|
| 11 |
|
| 12 |
-
git.Git(path).clone("https://github.com/ThereforeGames/txt2mask.git")
|
| 13 |
|
| 14 |
-
from zipfile import ZipFile
|
| 15 |
#zf = ZipFile('clipseg-master.zip', 'r')
|
| 16 |
#zf.extractall('clipseg/')
|
| 17 |
#zf.close()
|
| 18 |
-
|
| 19 |
-
ZipFile
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 31 |
|
| 32 |
#download_and_extract_zip_file()
|
| 33 |
#clone_github_repository()
|
|
|
|
| 1 |
+
import shutil
|
| 2 |
+
filename = "clipseg-master.zip"
|
| 3 |
+
extract_dir = "clipseg"
|
| 4 |
+
archive_format = "zip"
|
| 5 |
+
shutil.unpack_archive(filename, extract_dir, archive_format)
|
| 6 |
+
print("Archive file unpacked successfully.")
|
| 7 |
|
| 8 |
+
#import gradio as gr
|
| 9 |
+
#import git
|
| 10 |
+
#import os
|
| 11 |
+
|
| 12 |
+
#print('Get current working directory : ', os.getcwd())
|
| 13 |
+
#path=os.getcwd()
|
| 14 |
+
#path=os.getcwd()+"clipseg/"
|
| 15 |
|
| 16 |
+
#from pathlib import Path
|
| 17 |
+
#print('working path', Path.cwd())
|
| 18 |
|
| 19 |
+
#git.Git(path).clone("https://github.com/ThereforeGames/txt2mask.git")
|
| 20 |
|
| 21 |
+
#from zipfile import ZipFile
|
| 22 |
#zf = ZipFile('clipseg-master.zip', 'r')
|
| 23 |
#zf.extractall('clipseg/')
|
| 24 |
#zf.close()
|
| 25 |
+
|
| 26 |
+
#from zipfile import ZipFile
|
| 27 |
+
#ZipFile("clipseg-master.zip").extractall(path)
|
| 28 |
+
|
| 29 |
+
#import zipfile
|
| 30 |
+
#def un_zipFiles(path):
|
| 31 |
+
# files=os.listdir(path)
|
| 32 |
+
# for file in files:
|
| 33 |
+
# if file.endswith('.zip'):
|
| 34 |
+
# filePath=path+'/'+file
|
| 35 |
+
# zip_file = zipfile.ZipFile(filePath)
|
| 36 |
+
# for names in zip_file.namelist():
|
| 37 |
+
# zip_file.extract(names,path)
|
| 38 |
+
# zip_file.close()
|
| 39 |
|
| 40 |
#download_and_extract_zip_file()
|
| 41 |
#clone_github_repository()
|