23
23
TYPE_OBJECT_DETECTION ,
24
24
TYPE_SEMANTIC_SEGMENTATION ,
25
25
UNIVERSE_URL ,
26
+ TQDM_DESCRIPTIONS
26
27
)
27
28
from roboflow .core .dataset import Dataset
28
29
from roboflow .models .classification import ClassificationModel
@@ -740,9 +741,13 @@ def bar_progress(current, total, width=80):
740
741
# write the zip file to the desired location
741
742
with open (location + "/roboflow.zip" , "wb" ) as f :
742
743
total_length = int (response .headers .get ("content-length" ))
744
+ if TQDM_DESCRIPTIONS == "false" :
745
+ desc = None
746
+ else :
747
+ desc = f"Downloading Dataset Version Zip in { location } to { format } :"
743
748
for chunk in tqdm (
744
749
response .iter_content (chunk_size = 1024 ),
745
- desc = f"Downloading Dataset Version Zip in { location } to { format } :" ,
750
+ desc = desc ,
746
751
total = int (total_length / 1024 ) + 1 ,
747
752
):
748
753
if chunk :
@@ -766,10 +771,14 @@ def __extract_zip(self, location, format):
766
771
Raises:
767
772
RuntimeError: If there is an error unzipping the file
768
773
""" # noqa: E501 // docs
774
+ if TQDM_DESCRIPTIONS == "false" :
775
+ desc = None
776
+ else :
777
+ desc = f"Extracting Dataset Version Zip to { location } in { format } :"
769
778
with zipfile .ZipFile (location + "/roboflow.zip" , "r" ) as zip_ref :
770
779
for member in tqdm (
771
780
zip_ref .infolist (),
772
- desc = f"Extracting Dataset Version Zip to { location } in { format } :" ,
781
+ desc = desc ,
773
782
):
774
783
try :
775
784
zip_ref .extract (member , location )
0 commit comments