|
1 | 1 | import cv2
|
2 | 2 | import timeit
|
3 |
| -import glob |
4 | 3 | import argparse
|
5 | 4 | import os
|
6 | 5 | import multiprocessing as mp
|
7 | 6 | mp.set_start_method('spawn', force=True)
|
8 |
| -import sys |
9 |
| -import resource |
10 | 7 | import numpy as np
|
11 | 8 | import raster_processing
|
12 |
| -import to_agol |
| 9 | +from utils import to_shapefile |
| 10 | +from utils import to_agol |
| 11 | +from utils import features |
13 | 12 | import rasterio.warp
|
14 | 13 | import torch
|
15 | 14 | #import ray
|
16 | 15 | from collections import defaultdict
|
17 | 16 | from os import makedirs, path
|
18 |
| -from functools import partial |
19 | 17 | from pathlib import Path
|
20 |
| -from shapely.geometry import mapping |
21 | 18 | from torch.utils.data import DataLoader
|
22 |
| -from yacs.config import CfgNode |
23 | 19 | from skimage.morphology import square, dilation
|
24 | 20 | from tqdm import tqdm
|
25 | 21 |
|
26 | 22 |
|
27 | 23 | from dataset import XViewDataset
|
28 | 24 | from models import XViewFirstPlaceLocModel, XViewFirstPlaceClsModel
|
29 | 25 |
|
30 |
| -import functools |
31 | 26 | import logging
|
32 |
| -import struct |
33 |
| -import sys |
34 | 27 |
|
35 | 28 | logger = logging.getLogger()
|
36 | 29 |
|
@@ -541,10 +534,11 @@ def main():
|
541 | 534 | # Get files for creating shapefile and/or pushing to AGOL
|
542 | 535 | if args.create_shapefile or agol_push.get('dmg'):
|
543 | 536 | dmg_files = get_files(Path(args.output_directory) / 'dmg')
|
| 537 | + polygons = features.create_polys(dmg_files) |
544 | 538 |
|
545 | 539 | if args.create_shapefile:
|
546 | 540 | print('Creating shapefile')
|
547 |
| - raster_processing.create_shapefile(dmg_files, |
| 541 | + to_shapefile.create_shapefile(polygons, |
548 | 542 | Path(args.output_directory).joinpath('shapes') / 'damage.shp',
|
549 | 543 | args.destination_crs)
|
550 | 544 |
|
|
0 commit comments