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

Don't know how to proceed with "adding tf_record_from_coco.py to the ./ohsome2label/ directory" #4

Open
iboates opened this issue Jun 13, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@iboates
Copy link

iboates commented Jun 13, 2021

I am finding the walkthrough for satellite image building detection quite confusing.

I am using a Google Colab instace to test it out.

I have installed the package and then downloaded the tanzania dataset

!pip install ohsome2label
!rm -r tanzania
!ohsome2label --config config.yaml --schema schema.yaml vector
!ohsome2label --config config.yaml --schema schema.yaml label
!ohsome2label --config config.yaml --schema schema.yaml image
!ohsome2label --config config.yaml --schema schema.yaml visualize -t overlay

This works, I have the data downloaded & visualized properly.

But now the walkthrough says that I have to "Copy tf_record_from_coco.py from this repo to the ./ohsome2label/ directory". How can I do this? The package is installed somewhere in the system's native Python directory. Do I really have to go searching for where this package was installed in site-packages to add this file?

@iboates iboates changed the title ImportError: cannot import name 'dataset_util' from 'utils' Don't know how to proceed with "adding tf_record_from_coco.py to the ./ohsome2label/ directory" Jun 13, 2021
@bobleegogogo
Copy link
Contributor

sorry for this late reply @iboates .

But now the walkthrough says that I have to "Copy tf_record_from_coco.py from this repo to the ./ohsome2label/ directory". How can I do this? The package is installed somewhere in the system's native Python directory. Do I really have to go searching for where this package was installed in site-packages to add this file?

No, in principle, you can run this "tf_record_from_coco.py" anywhere. Importantly, you will also need to copy this file "dataset_util.py" together, it was needed by "tf_record_from_coco.py". I just uploaded it with commit cd7426a.

Then you just have to specify the relative path to the data folder when running the "tf_record_from_coco.py"

$ python tf_record_from_coco.py
--label_input=#path-to-folder-tanzania
--train_rd_path=#output-file: train.record
--valid_rd_path=#output-file: valid.record

Hope this helps!

ps: Actually, the original text refers to the situation when you clone the Github repo and install it locally with "pip install --editable ."

@bobleegogogo bobleegogogo added the bug Something isn't working label Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants