Giter VIP home page Giter VIP logo

Comments (8)

NickT5 avatar NickT5 commented on June 17, 2024

My first attempt to filter out duplicates would be to subtract two possible duplicated images and check if the difference is close to zero.

from bing_image_downloader.

atsbomb avatar atsbomb commented on June 17, 2024

I'm getting the same. Downloaded 10000 pictures and 9789 of them were duplicates. Is this a nature of Bing image search, or particular to this downloader?

from bing_image_downloader.

jane-cz avatar jane-cz commented on June 17, 2024

When I scrape 100 photos, after the first 85 to 90 images, they start to repeat, and the rest are all duplicates.
When I scrape 500 photos, 370 of them are duplicates :(
Other than this it works great, so I really hope this issue can get fixed.

from bing_image_downloader.

AbhiDhariwal avatar AbhiDhariwal commented on June 17, 2024

Ya I also faced same issue it was due to how its programed i.e there is no next page in bing so instead first=pagecounter -> do first len of total url visited
also added ignore duplicates if same url is already visited
i will also pull the code or you can visit https://github.com/AbhiDhariwal/bing_image_downloader

from bing_image_downloader.

shoppel avatar shoppel commented on June 17, 2024

I successfully avoided duplicated images with the following code. But now it will search forever. So yeah,
maybe we need a next button for more images.

`
self.duplicates = set()

def save_image(self, link, file_path):
    request = urllib.request.Request(link, None, self.headers)
    image = urllib.request.urlopen(request, timeout=self.timeout).read()
    
    if not imghdr.what(None, image) or image in self.duplicates:
        print('[Error]Invalid image, not saving {}\n'.format(link))
        raise
    else:
        self.duplicates.add(image)

    with open(file_path, 'wb') as f:
        f.write(image)

`

from bing_image_downloader.

sid7631 avatar sid7631 commented on June 17, 2024

Remove duplicates PR#20

from bing_image_downloader.

annabaringer avatar annabaringer commented on June 17, 2024

Bumping this as an issue. The fix above looks like it works and would be great if merged. Thanks!

from bing_image_downloader.

sid7631 avatar sid7631 commented on June 17, 2024

Please close this issue

from bing_image_downloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.