def main(path):
    ids = [1282, 1285, 1287, 1168, 1035, 1037, 1298, 1299, 1241, 792]
    images1 = Images.load_group(2)
    images = {i: images1.images[i] for i in ids}
    images = Images(3, images, images1.next_id,
                    description='Images uploaded to panoptes staging project')
    print(path)

    pan.Uploader._client = pan.Panoptes(
        login='******',
        endpoint='https://panoptes-staging.zooniverse.org')

    images.upload_subjects(path)
예제 #2
0
def unlink(group):
    print('Unlinking subjects')
    images = Images.load_group(group)
    to_remove = []
    for i in images.iter():
        if i.zoo_id is not None:
            to_remove.append(i.zoo_id)
            i.zoo_id = None
    print('Unlinking %d subjects' % len(to_remove))
    if len(to_remove) > 0:
        uploader = panoptes.Uploader(muon.config.project, group)
        uploader.unlink_subjects(to_remove)
        images.save_group(overwrite=True)
예제 #3
0
def main():
    images = Images.load_group(0)
    uploader = pan.Uploader(5918, 0)
    print('Updating metadata')

    for subject in uploader.subject_set.subjects:
        print(subject)
        image = images.images[subject.metadata['id']]
        print(image)

        print(subject.metadata)
        subject.metadata = image.dump_manifest()
        print(subject.metadata)

        subject.save()
    print('done')
예제 #4
0
def main():
    images = Images.load_group(0)

    to_remove = []
    for image in images.images:
        if image.metadata['cluster'] == 0:
            to_remove.append(image)

    for i in to_remove:
        print(i)

    images.remove_images([i.id for i in to_remove])

    uploader = pan.Uploader(5918, images.group)
    uploader.unlink_subjects([i.zoo_id for i in to_remove])
    images.save_group(True)

    import code
    code.interact(local=locals())
예제 #5
0
def main():
    for g in [1, 2]:
        images = Images.load_group(g)
        for image in images.iter():
            N = len(image.subjects)
            cols = 10
            rows = math.ceil(N/10)
            image.metadata.update({
                'figure': {
                    'cols': cols,
                    'rows': rows,
                    'height': 2*rows,
                    'width': 2*cols,
                    'dpi': 100,
                    'offset': 0.03*(2*cols),
                    'beta_image': True,
                }
            })

        images.save_group(overwrite=True)
예제 #6
0
def test(subjects):
    subjects = pickle.load(open(subjects, 'rb'))
    images = Images.new(subjects)
    interact(locals())
예제 #7
0
def list():
    groups = Images._list_groups()
    print('%d groups in images file:' % len(groups))
    print(' '.join(groups))
예제 #8
0
def upload(group, path):
    images = Images.load_group(group)
    images.upload_subjects(path)

    interact(locals())