ieee8023 / covid-chestxray-dataset

We are building an open database of COVID-19 cases with chest X-ray or CT images.
2.99k stars 1.28k forks source link

how to I can run this code #179

Open manhhung99 opened 3 years ago

manhhung99 commented 3 years ago

I run browse_page_from_cache.py and then I have a problem with code: AttributeError: type object 'MHTMLCache' has no attribute 'source'. Can you help me fix this? Thank you very much!

bganglia commented 3 years ago

If you want to use the dataset itself, you should use xrv.datasets.COVID19_Dataset() from the torchxrayvision library.

The scripts you are looking at are used for adding more data to the dataset. combined_interface.py is the main one, and it scrapes data from Radiopaedia.org and Eurorad.org. Once some data has been scraped, you can run browse_page_from_cache.py to revisit the URLs of scraped pages.

Before you run combined_interface.py, make sure you download the chromedriver for your version of Chrome and unzip it in the same directory where you cloned the covid-chestxray-dataset.

manhhung99 commented 3 years ago

As you say, I have to run combined_interface.py file, then I will run browse_page_from_cache.py file. And it request that: "combined_interface.py: error: the following arguments are required: search, newimg, newcsv, csv, max_results, results_from, handle_failure". I don't know how to fix this. Can you help me? Thank you!

bganglia commented 3 years ago

Ok, following the example in combined_interface.py, it should work if you run this command in the scripts directory:

python combined_interface.py "search terms" image_output_folder/ new_metadata_filename.csv ../metadata.csv 10 internal retry

Just replace "search terms" with some terms describing the type of radiographs you are looking for, such as "COVID" or "pneumonia". You can run python combined_interface.py --help for more information on what the other arguments mean.

Also, note that you need to have wget installed. If you are on Windows, you may have to add this to your PATH.

It may help if you could explain some more about how you want to use the code.