Comments (8)
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.
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.
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.
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.
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.
Remove duplicates PR#20
from bing_image_downloader.
Bumping this as an issue. The fix above looks like it works and would be great if merged. Thanks!
from bing_image_downloader.
Please close this issue
from bing_image_downloader.
Related Issues (20)
- Circular import HOT 2
- Photo search with txt list
- There should be an option to use an absolute path as out_dir HOT 1
- Not working anymore HOT 3
- Broken, results do not resemble same query via web HOT 2
- Force Replace option not functioning due to typo. HOT 3
- option to keep original image names HOT 1
- Search food, but download many menu images HOT 2
- Error:: URL can't contain control characters. (found at least ' ')
- Worked fine yesterday, but showing error for me today. HOT 4
- Error:: 'ascii' codec can't encode character '\xf1' in position 46: ordinal not in range(128)
- Can We pass image licence type filter as bing search give an option to do so ? HOT 1
- Typo error in the documentation page on pypi.org
- [`Formating`] : Format the code using Black
- Os is not used here
- why joining the search query in the download path, this giving me issues while trying to open the images
- It simply hangs
- Getting original URLs
- Why quotation marks do not work?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bing_image_downloader.