예제 #1
0
 def FromQuilt(
     package: str = DEFAULT_QUILT_PKG,
     hash: str = None,
     version: str = DEFAULT_QUILT_VERSION,
     tag: str = None,
     force: bool = True,
 ) -> object:
     """Create a GroupsData object from quilt."""
     quilt.install(
         package=package,
         version=version,
         force=force,
         tag=tag,
         hash=hash,
     )
     cc_pkg = quilt.load(DEFAULT_QUILT_PKG)
     return GroupsData.FromDataFrame(cc_pkg.data.group_definitions())
예제 #2
0
파일: quilt.py 프로젝트: jalabort/nucleus
def get_pkg(user: str,
            package: str,
            hash_key=None,
            force=True) -> pd.DataFrame:
    r"""

    Parameters
    ----------
    user
    package
    hash_key
    force

    Returns
    -------

    """
    pkg_path = f'{user}/{package}'
    quilt.install(pkg_path, hash=hash_key, force=force)
    return quilt.load(pkg_path)
예제 #3
0
def get_deepbedmap_model_inputs(
    window_bound: rasterio.coords.BoundingBox,
    padding: int = 1000,
    use_whole_rema: bool = False,
) -> (np.ndarray, np.ndarray, np.ndarray, np.ndarray):
    """
    Outputs one large tile for each of:
    BEDMAP2, REMA, MEASURES Ice Flow Velocity and Antarctic Snow Accumulation
    according to a given window_bound in the form of (xmin, ymin, xmax, ymax).
    """
    data_prep = _load_ipynb_modules("data_prep.ipynb")

    if window_bound == rasterio.coords.BoundingBox(
        left=-1_594_000.0, bottom=-166_500.0, right=-1_575_000.0, top=-95_500.0
    ):
        # Quickly pull from cached quilt storage if using (hardcoded) test region
        quilt.install(package="weiji14/deepbedmap/model/test", force=True)
        pkg = quilt.load(pkginfo="weiji14/deepbedmap/model/test")
        X_tile = pkg.X_tile()
        W1_tile = pkg.W1_tile()
        W2_tile = pkg.W2_tile()
        W3_tile = pkg.W3_tile()
예제 #4
0
#!/usr/bin/env python3.6

import quilt

import const
import util

node1 = quilt.load(const.PKG, hash=const.HASH1)
node2 = quilt.load(const.PKG)  # latest

# Read jsonl
jsonl1 = node1.dump_json()
jsonl2 = node2.dump_json()

print(util.read_jsonl(jsonl1))
print(util.read_jsonl(jsonl2))

# Read text
text1 = node1.dump_txt()
text2 = node2.dump_txt()

print(util.read_text(text1))
print(util.read_text(text2))
예제 #5
0
copyTime = time.time() - t

print('########Copy Completed#########')

FilterAndSavePandasTable(folds, allImageIDs, annList, packagePath, logPath)
print('######## Panda Table Generated#########')

GenerateREADME(packagePath + 'README.md', classDescription)
if (os.path.exists(packagePath + 'build.yml')):
    os.remove(packagePath + 'build.yml')

t = time.time()
quilt.generate(packagePath)
quilt.build(quiltUser + '/' + classDescription, packagePath + 'build.yml')

pkgNode = quilt.load(quiltUser + '/' + classDescription)

pkgNode._meta['trainable'] = classID in oi.classes_trainable().values
pkgNode._meta['labelName'] = classDescription
numImages = GetNumImages(folds, allImageIDs)
pkgNode._meta['image_count'] = numImages

GenerateImageMetadata(folds, allImageIDs, pkgNode, annList, logPath,
                      imagePrefix)
print('######## Image Metadata Generated#########')

quilt.build(quiltUser + '/' + classDescription, pkgNode)
print('######## New Package Generated#########')

buildPkgTime = time.time() - t