Skip to content

Commit

Permalink
Ultralytics Refactor https://ultralytics.com/actions (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Jun 20, 2024
1 parent 82cb8a4 commit 38b617f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<br>
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320">
<a href="https://ultralytics.com" target="_blank"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>

# 🚀 Introduction

Expand Down Expand Up @@ -103,7 +103,7 @@ If you encounter any issues or have features you'd like to request, please visit
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://www.instagram.com/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-instagram.png" width="3%" alt="Ultralytics Instagram"></a>
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics Instagram"></a>
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
<a href="https://ultralytics.com/discord"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
</div>
Expand Down
10 changes: 5 additions & 5 deletions bing_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ def download_image(
):
download_message = ""
if not download:
download_message = "%s %s" % (image_url, download_message)
download_message = f"{image_url} {download_message}"
return "success", download_message, None, image_url

if ignore_urls and any(url in image_url for url in ignore_urls.split(",")):
Expand Down Expand Up @@ -869,15 +869,15 @@ def download_image(
download_message = "Wrong image format returned. Skipping..."
return_image_name = ""
absolute_path = ""
download_message = "%s %s" % (image_url, download_message)
download_message = f"{image_url} {download_message}"
return download_status, download_message, return_image_name, absolute_path

if image_format == "" or not image_format or f".{image_format}" not in extensions:
download_status = "fail"
download_message = "Invalid or missing image format. Skipping..."
return_image_name = ""
absolute_path = ""
download_message = "%s %s" % (image_url, download_message)
download_message = f"{image_url} {download_message}"
return download_status, download_message, return_image_name, absolute_path
elif image_name.lower().find(f".{image_format}") < 0:
image_name = f"{image_name}.{image_format}"
Expand Down Expand Up @@ -907,12 +907,12 @@ def download_image(

# return image name back to calling method to use it for thumbnail downloads
download_status = "success"
download_message = "%s %s" % (image_url, download_message)
download_message = f"{image_url} {download_message}"
return_image_name = prefix + str(count) + "." + image_name

# image size parameter
if not silent_mode and print_size:
print("Image Size: " + str(self.file_size(path)))
print(f"Image Size: {str(self.file_size(path))}")

except UnicodeEncodeError as e:
download_status = "fail"
Expand Down

0 comments on commit 38b617f

Please sign in to comment.