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

how to I can run this code #179

Open
manhhung99 opened this issue Mar 22, 2021 · 3 comments
Open

how to I can run this code #179

manhhung99 opened this issue Mar 22, 2021 · 3 comments

Comments

@manhhung99
Copy link

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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.

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

No branches or pull requests

2 participants