Closed shubham-scisar closed 4 years ago
Yes, you can specify the geojson
parameter and skip the label-maker download
step
I am trying to create labels but unfortunately it is not able to find the path,I have checked the path there is no issue with path.
(base) C:\Users\SHUBHAM>label-maker labels --dest U:\new_pune\pune_1 --config U:\pune_config.json
Traceback (most recent call last):
File "C:\Users\SHUBHAM\Anaconda3\Scripts\label-maker-script.py", line 9, in <module>
sys.exit(cli())
File "C:\Users\SHUBHAM\Anaconda3\lib\site-packages\label_maker\main.py", line 104, in cli
make_labels(dest_folder=dest_folder, sparse=sparse, **config)
File "C:\Users\SHUBHAM\Anaconda3\lib\site-packages\label_maker\label.py", line 84, in make_labels
mbtiles_file_zoomed, filtered_geo])
File "C:\Users\SHUBHAM\Anaconda3\lib\subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\SHUBHAM\Anaconda3\lib\subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "C:\Users\SHUBHAM\Anaconda3\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
This is my json file :
{
"country": "india",
"bounding_box": [1.09725, 6.05520, 1.34582, 6.30915],
"geojson":"E:\\pune_corp\\labels.geojson",
"zoom":19,
"classes": [{ "name": "schools","filter":["has"]}],
"imagery": "E:\\part1_cog.tif",
"background_ratio": 1,
"ml_type": "object-detection"
}
@shubhamsharma1609 can you try the paths with single slashes (rather than double)?
Tried but Getting this error :
Traceback (most recent call last):
File "C:\Users\SHUBHAM\Anaconda3\Scripts\label-maker-script.py", line 9, in <module>
sys.exit(cli())
File "C:\Users\SHUBHAM\Anaconda3\lib\site-packages\label_maker\main.py", line 73, in cli
config = json.load(open(args.get('config')))
File "C:\Users\SHUBHAM\Anaconda3\lib\json\__init__.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Users\SHUBHAM\Anaconda3\lib\json\__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Users\SHUBHAM\Anaconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\SHUBHAM\Anaconda3\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 4 column 16 (char 95)
Invalid escape.
@shubhamsharma1609 unfortunately I don't have access to a Windows machine to debug this. Can you check anything related to not finding the path (file permissions, file name, spaces, case, etc)?
I am checking that.Also, I am utilising the geojson file having mutlipolygon but as per the documentation it is mentioned that only polygon should be there. Can you please guide how I can package this as .npz for creation of npz file as per label maker or any other approach ?
@shubhamsharma1609 you can convert the MultiPolygon into a FeatureCollection of Polygons
I am running in linux and getting the following error. Even when the geojson(containing feature collection) is supplied at the right path now it is giving bounding box error.Whereas in the documentation it is given as that the bounding box and country will be overridden by the geojson. If we can label every geotiff file with custom labels,this will prove to be very powerful.Please help.
(env) abc@linux:~/Downloads$ label-maker labels --config pune_config.json
Determining labels for each tile
Traceback (most recent call last):
File "/home/abc/miniconda3/envs/env/bin/label-maker", line 10, in <module>
sys.exit(cli())
File "/home/abc/miniconda3/envs/env/lib/python3.8/site-packages/label_maker/main.py", line 104, in cli
make_labels(dest_folder=dest_folder, sparse=sparse, **config)
File "/home/abc/miniconda3/envs/env/lib/python3.8/site-packages/label_maker/label.py", line 89, in make_labels
tilereduce(dict(zoom=zoom, source=mbtiles_to_reduce, bbox=bounding_box,
File "/home/abc/miniconda3/envs/env/lib/python3.8/site-packages/tilepie/__init__.py", line 21, in tilereduce
tiles = tm.tileslist(bbox=options.get('bbox'), zoomlevels=[zoom])
File "/home/abc/miniconda3/envs/env/lib/python3.8/site-packages/tilepie/reader.py", line 68, in tileslist
return proj.tileslist(bbox)
File "/home/abc/miniconda3/envs/env/lib/python3.8/site-packages/tilepie/proj.py", line 106, in tileslist
raise InvalidCoverageError(_("Wrong format of bounding box."))
tilepie.proj.InvalidCoverageError: Wrong format of bounding box.
which version of label-maker are you using?
label-maker 0.8.0. Also,my geojson is a feature collection only.
If you have non-polygon features, you'll need to update to 0.9.0 (just released)
The geojson consists of multi polygons in the form of feature collection.
The geojson file which I have is created from the groundwork tool from azavea and I am using the same geojson file to create labelled dataset https://github.com/developmentseed/label-maker/issues/32 and I am unable to generate custom labels for the local file.
Can you upgrade to 0.9.0 and show me the geojson file + config.json?
I have an imagery (in geotiff) and have a separate geojson to label the image.Kindly guide how can I use these two as inputs for label-maker to create npz file.I do not wish to use OSM data as I already have the data in geotiff and label in geojson.