зеркало из https://github.com/microsoft/torchgeo.git
Run linters on tests/data (#356)
* Run linters on tests/data * Configuration: use .gitignore for tool skip Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Родитель
08a365f55b
Коммит
4bd4f2acdc
|
@ -9,31 +9,6 @@ build-backend = "setuptools.build_meta"
|
|||
target-version = ["py36", "py37", "py38", "py39"]
|
||||
color = true
|
||||
skip_magic_trailing_comma = true
|
||||
exclude = '''
|
||||
/(
|
||||
# TorchGeo
|
||||
| data
|
||||
| logo
|
||||
| logs
|
||||
| output
|
||||
|
||||
# Spack
|
||||
| \.spack-env
|
||||
|
||||
# Python
|
||||
| build
|
||||
| dist
|
||||
| \.cache
|
||||
| \.mypy_cache
|
||||
| \.pytest_cache
|
||||
| __pycache__
|
||||
| .*\.egg-info
|
||||
|
||||
# Git
|
||||
| \.git
|
||||
| \.github
|
||||
)/
|
||||
'''
|
||||
|
||||
[tool.coverage.report]
|
||||
# Ignore warnings for overloads
|
||||
|
@ -46,7 +21,6 @@ exclude_lines = [
|
|||
[tool.isort]
|
||||
profile = "black"
|
||||
known_first_party = ["docs", "tests", "torchgeo", "train"]
|
||||
extend_skip = [".spack-env/", "data", "logs", "output"]
|
||||
skip_gitignore = true
|
||||
color_output = true
|
||||
|
||||
|
|
|
@ -5,15 +5,14 @@
|
|||
|
||||
import bz2
|
||||
import csv
|
||||
import hashlib
|
||||
import glob
|
||||
import hashlib
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
||||
SIZE = 64 # image width/height
|
||||
STOP = 20 # range of values for labels
|
||||
PREFIX = "Counting"
|
||||
|
|
|
@ -5,15 +5,14 @@
|
|||
|
||||
import bz2
|
||||
import csv
|
||||
import hashlib
|
||||
import glob
|
||||
import hashlib
|
||||
import os
|
||||
import random
|
||||
import shutil
|
||||
|
||||
from PIL import Image
|
||||
|
||||
|
||||
SIZE = 64 # image width/height
|
||||
STOP = 2 # range of values for labels
|
||||
PREFIX = "Detection"
|
||||
|
|
|
@ -10,7 +10,6 @@ import shutil
|
|||
import numpy as np
|
||||
from PIL import Image
|
||||
|
||||
|
||||
SIZE = 64 # image width/height
|
||||
|
||||
np.random.seed(0)
|
||||
|
|
|
@ -9,8 +9,8 @@ import shutil
|
|||
|
||||
import numpy as np
|
||||
import rasterio
|
||||
from rasterio.transform import Affine
|
||||
from rasterio.crs import CRS
|
||||
from rasterio.transform import Affine
|
||||
|
||||
SIZE = 64 # image width/height
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import os
|
|||
import h5py
|
||||
import numpy as np
|
||||
|
||||
|
||||
SIZE = 64 # image width/height
|
||||
NUM_CLASSES = 17
|
||||
NUM_SAMPLES = 1
|
||||
|
|
|
@ -4,12 +4,11 @@
|
|||
# Licensed under the MIT License.
|
||||
|
||||
import os
|
||||
import h5py
|
||||
from pathlib import Path
|
||||
|
||||
import h5py
|
||||
import numpy as np
|
||||
|
||||
|
||||
# Sentinel-2 is 12-bit with range 0-4095
|
||||
SENTINEL2_MAX = 4096
|
||||
|
||||
|
@ -34,20 +33,12 @@ Path(labels_file).touch()
|
|||
|
||||
# Create dataset file
|
||||
data = np.random.randint(
|
||||
SENTINEL2_MAX,
|
||||
size=(NUM_SAMPLES, 1, SIZE, SIZE, NUM_CHANNELS),
|
||||
dtype=np.int16
|
||||
SENTINEL2_MAX, size=(NUM_SAMPLES, 1, SIZE, SIZE, NUM_CHANNELS), dtype=np.int16
|
||||
)
|
||||
data = data.astype(np.float64)
|
||||
gt = np.random.randint(
|
||||
NUM_CLASSES,
|
||||
size=(NUM_SAMPLES, SIZE, SIZE, 1),
|
||||
dtype=np.int16
|
||||
)
|
||||
gt = np.random.randint(NUM_CLASSES, size=(NUM_SAMPLES, SIZE, SIZE, 1), dtype=np.int16)
|
||||
gt_instance = np.random.randint(
|
||||
NUM_CLASSES,
|
||||
size=(NUM_SAMPLES, SIZE, SIZE, 1),
|
||||
dtype=np.int32
|
||||
NUM_CLASSES, size=(NUM_SAMPLES, SIZE, SIZE, 1), dtype=np.int32
|
||||
)
|
||||
|
||||
with h5py.File(data_file, "w") as f:
|
||||
|
|
Загрузка…
Ссылка в новой задаче