nightfury commited on
Commit
5f4b7ef
1 Parent(s): aa493c0

Update app_t.py

Browse files
Files changed (1) hide show
  1. app_t.py +31 -23
app_t.py CHANGED
@@ -1,33 +1,41 @@
1
- import gradio as gr
2
- import git
3
- import os
 
 
 
4
 
5
- print('Get current working directory : ', os.getcwd())
6
- path=os.getcwd()
7
- path=os.getcwd()+"clipseg/"
 
 
 
 
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
- from zipfile import ZipFile
19
- ZipFile("clipseg-master.zip").extractall(path)
20
-
21
- import zipfile
22
- def un_zipFiles(path):
23
- files=os.listdir(path)
24
- for file in files:
25
- if file.endswith('.zip'):
26
- filePath=path+'/'+file
27
- zip_file = zipfile.ZipFile(filePath)
28
- for names in zip_file.namelist():
29
- zip_file.extract(names,path)
30
- zip_file.close()
 
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()