Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python docstrings and reformat #24

Merged
merged 2 commits into from
Apr 28, 2024
Merged

Add Python docstrings and reformat #24

merged 2 commits into from
Apr 28, 2024

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Apr 28, 2024

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced documentation and improved image handling in Flickr scraper and utility functions. πŸ“Έβœ¨

πŸ“Š Key Changes

  • Added detailed docstrings to functions, making the code easier to understand and use. πŸ“
  • Improved URL construction for fetching images from Flickr, ensuring more reliability in retrieving original size images. πŸ”—
  • Enhanced image processing in clean_images.py, including resizing, converting to JPG, and removing corrupt or duplicate files, with clearer documentation on functionality and arguments. πŸ–ΌοΈβž•
  • Updated download_uri function with better error handling and support for additional image formats, increasing robustness. πŸ› οΈ
  • Introduced a function in multithread_example.py demonstrating how to download files with error handling, useful for learning about multithreading applications. 🧡

🎯 Purpose & Impact

  • Purpose: These changes aim to make the Flickr scraper more efficient, user-friendly, and versatile in handling different image formats and downloading tasks. The addition of comprehensive documentation further aids developers and users in understanding and leveraging the tool's capabilities effectively.
  • Impact: Users will benefit from more reliable image fetching and processing, enabling better data collection for projects requiring image datasets. The clear documentation also lowers the entry barrier for new users or contributors, potentially increasing the tool's user base and contribution rate. These updates may also lead to improvements in image-based machine learning or data analysis projects by providing a more robust toolset for image acquisition and preprocessing. πŸš€πŸ‘₯

@glenn-jocher glenn-jocher changed the title Add docstrings and reformat Add Python docstrings and reformat Apr 28, 2024
@glenn-jocher glenn-jocher merged commit d8c596c into main Apr 28, 2024
@glenn-jocher glenn-jocher deleted the updates branch April 28, 2024 13:55
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @glenn-jocher - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟑 General issues: 1 issue found
  • 🟒 Security: all looks good
  • 🟒 Testing: all looks good
  • 🟒 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment to tell me if it was helpful.

Comment on lines 2 to 6
import cv2
import glob
import numpy as np
import os
from PIL import Image
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code_refinement): Consider grouping similar imports together for better readability.

Grouping similar imports, such as those for image processing libraries like cv2 and PIL, can enhance the clarity and organization of the code.

Suggested change
import cv2
import glob
import numpy as np
import os
from PIL import Image
import glob
import os
import cv2
import numpy as np
from PIL import Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants