Skip to content

Commit f56c062

Browse files
committed
project.py fixes for uploading hosted images
Two small changes: (1) When passing in a URL (for hosted image)'self.check_valid_image(path)' doesn't need to run, so we put 'is_hosted' before in the 'or' statement. (2) When pushing to the API for upload, we had 'self.project_name' which doesn't exists. It should be 'project_name' which is calculated a few lines prior.
1 parent 79c7013 commit f56c062

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roboflow/core/project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def __image_upload(
427427

428428
upload_url = "".join(
429429
[
430-
API_URL + "/dataset/" + self.project_name + "/upload",
430+
API_URL + "/dataset/" + project_name + "/upload",
431431
"?api_key=" + self.__api_key,
432432
"&name=" + os.path.basename(image_path),
433433
"&split=" + split,
@@ -623,7 +623,7 @@ def upload(
623623
)
624624

625625
if is_file:
626-
is_image = self.check_valid_image(image_path) or is_hosted
626+
is_image = is_hosted or self.check_valid_image(image_path)
627627

628628
if not is_image:
629629
raise RuntimeError(

0 commit comments

Comments
 (0)