Skip to content

Commit 32a220b

Browse files
committed
pt weights download
1 parent fc9caf7 commit 32a220b

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

roboflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from roboflow.core.workspace import Workspace
1313
from roboflow.util.general import write_line
1414

15-
__version__ = "1.0.3"
15+
__version__ = "1.0.4"
1616

1717

1818
def check_key(api_key, model, notebook, num_retries=0):

roboflow/core/version.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -432,22 +432,20 @@ def live_plot(epochs, mAP, loss, title=""):
432432

433433
# return the model object
434434
return self.model
435-
435+
436436
def get_pt_weights(self, location="."):
437-
438437
workspace, project, *_ = self.id.rsplit("/")
439-
440-
#get pt url
438+
439+
# get pt url
441440
pt_api_url = f"{API_URL}/{workspace}/{project}/{self.version}/ptFile"
442-
441+
443442
r = requests.get(pt_api_url, params={"api_key": self.__api_key})
444-
443+
445444
r.raise_for_status()
446-
445+
447446
pt_weights_url = r.json()["weightsUrl"]
448-
449-
def bar_progress(current, total, width=80):
450447

448+
def bar_progress(current, total, width=80):
451449
progress_message = (
452450
"Downloading weights to "
453451
+ location
@@ -456,9 +454,9 @@ def bar_progress(current, total, width=80):
456454
)
457455
sys.stdout.write("\r" + progress_message)
458456
sys.stdout.flush()
459-
457+
460458
wget.download(pt_weights_url, out=location + "/weights.pt", bar=bar_progress)
461-
459+
462460
return
463461

464462
# @warn_for_wrong_dependencies_versions([("ultralytics", "<=", "8.0.20")])

0 commit comments

Comments
 (0)