Esempio n. 1
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    configure_experiment(
        slug='quality_scene',
        template_dir='photos/experiments',
        module='photos.experiments',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.02'),
        num_outputs_max=5,
        contents_per_hit=50,
        content_type_model=Photo,
        out_content_type_model=PhotoSceneQualityLabel,
        out_content_attr='photo',
        content_filter='{}',
        title='Click on images that belong to a scene category',
        description='Given a collection of images, your job is to decide which images '
                    'belong to that scene category.',
        keywords='category,images,collection,image,picture,classify',
        #frame_height=8000,
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='label_whitebalance',
        template_dir='photos/experiments',
        module='photos.experiments',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.05'),
        num_outputs_max=5,
        contents_per_hit=15 if production else 4,
        max_active_hits=50,
        content_type_model=Photo,
        out_content_type_model=PhotoWhitebalanceLabel,
        out_content_attr='photo',
        content_filter={
            'scene_category_correct': True,
            'num_shapes__gt': 0,
        },
        title='Click on white or gray things in images',
        description='Your task is to click on points in an image that are white or gray.',
        keywords='whitebalance,appearance,image,picture,label',
        requirements={
            'min_points': 3
        },
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )
Esempio n. 2
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    configure_experiment(
        slug='quality_scene',
        template_dir='photos/experiments',
        module='photos.experiments',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.02'),
        num_outputs_max=5,
        contents_per_hit=50,
        content_type_model=Photo,
        out_content_type_model=PhotoSceneQualityLabel,
        out_content_attr='photo',
        content_filter='{}',
        title='Click on images that belong to a scene category',
        description=
        'Given a collection of images, your job is to decide which images '
        'belong to that scene category.',
        keywords='category,images,collection,image,picture,classify',
        #frame_height=8000,
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='label_whitebalance',
        template_dir='photos/experiments',
        module='photos.experiments',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.05'),
        num_outputs_max=5,
        contents_per_hit=15 if production else 4,
        max_active_hits=50,
        content_type_model=Photo,
        out_content_type_model=PhotoWhitebalanceLabel,
        out_content_attr='photo',
        content_filter={
            'scene_category_correct': True,
            'num_shapes__gt': 0,
        },
        title='Click on white or gray things in images',
        description=
        'Your task is to click on points in an image that are white or gray.',
        keywords='whitebalance,appearance,image,picture,label',
        requirements={'min_points': 3},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )
Esempio n. 3
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    configure_experiment(
        slug='segment_material',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.12'),
        num_outputs_max=6,
        out_count_ratio=6,
        contents_per_hit=1,
        max_active_hits=200,
        content_type_model=Photo,
        out_content_type_model=SubmittedShape,
        out_content_attr='photo',
        content_filter={
            'scene_category_correct': True,
            'license__creative_commons': True,
            'license__cc_no_deriv': False,
        },
        duration=60 * 60 * 3,
        title='Draw shapes in images',
        description=
        'Draw polygons around regions that have the same material in a photograph.',
        keywords='material,substance,polygon,shape,draw,image,picture,classify',
        requirements={
            'min_shapes': 6,
            'min_vertices': 3
        },
        qualifications='{ "mat_seg": 1 }',
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='quality_material',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.04'),
        num_outputs_max=5 if production else 10,
        contents_per_hit=40,
        content_type_model=MaterialShape,
        out_content_attr='shape',
        out_content_type_model=MaterialShapeQuality,
        content_filter={
            'invalid': False,
            'correct__isnull': True,
            'pixel_area__gt': Shape.MIN_PIXEL_AREA,
            'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
        },
        title='Click on images that contain a single material',
        description=
        'This task involves clicking on images that contain a single type of material or texture within a red boundary.',
        keywords='material,substance,shape,image,picture,classify,label',
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
        #examples_good=MaterialShape.objects.filter(
        #qualities__user=examples_user,
        #qualities__correct=True).order_by('?')[:200],
        #examples_bad=MaterialShape.objects.filter(
        #qualities__user=examples_user,
        #qualities__correct=False).order_by('?')[:200],
    )

    configure_experiment(
        slug='label_substance',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.10'),
        num_outputs_max=5,
        min_output_consensus=3,
        contents_per_hit=40,
        #max_active_hits=200,
        content_type_model=MaterialShape,
        out_content_type_model=ShapeSubstanceLabel,
        out_content_attr='shape',
        content_filter={
            'invalid': False,
            'correct': True,
            'pixel_area__gt': Shape.MIN_PIXEL_AREA,
            'num_vertices__gte': 4,
            #'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
        },
        title='Click on the name of a material in an image',
        description=
        'Given a shape highlighted in an image, select its material from a list.',
        keywords='material,substance,appearance,image,picture,classify',
        frame_height=1200,
        requirements={},
        #qualifications='{ "substance": 1 }',
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='label_planarity',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.04'),
        num_outputs_max=5 if production else 10,
        contents_per_hit=40,
        content_type_model=MaterialShape,
        out_content_type_model=ShapePlanarityLabel,
        out_content_attr='shape',
        content_filter={
            'invalid': False,
            'pixel_area__gt': Shape.MIN_PLANAR_AREA,
            'correct': True,
            'substance__isnull': False,
            'substance__fail': False,
            'num_vertices__gte': 4,
            #'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
        },
        title='Click on images of planar objects',
        description=
        'Your task is to select the planar objects out of a collection of images.',
        keywords=
        'flat,planar,appearance,polygon,shape,draw,image,picture,classify,label',
        #frame_height=7500,
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
        #examples_good=MaterialShape.objects.filter(
        #planarities__user=examples_user,
        #planarities__planar=True).order_by('?')[:200],
        #examples_bad=MaterialShape.objects.filter(
        #planarities__user=examples_user,
        #planarities__planar=False).order_by('?')[:200],
    )

    for group in ShapeSubstanceGroup.objects.filter(active=True):
        configure_experiment(
            slug='label_name',
            template_dir='shapes/experiments',
            module='shapes.experiments',
            examples_group_attr='shape',
            variant=json.dumps({'substance_group_id': group.id}),
            completed_id='label_name',
            version=1,  # 2: intrinsic images, 1: original opensurfaces
            reward=Decimal('0.10'),
            num_outputs_max=5,
            min_output_consensus=3,
            contents_per_hit=50,
            content_type_model=MaterialShape,
            out_content_type_model=MaterialShapeNameLabel,
            out_content_attr='shape',
            content_filter={
                'invalid': False,
                'pixel_area__gt': Shape.MIN_PIXEL_AREA,
                'correct': True,
                'substance__isnull': False,
                'substance__group_id': group.id,
                'photo__scene_category_correct': True,
                'num_vertices__gte': 4,
                #'photo__scene_category__name': 'kitchen',
            },
            frame_height=1200,
            title='Click on the name of an object in an image',
            description=
            'Given an object highlighted in an image, select its common English name from a list. (id: %s)'
            % group.id,
            keywords='object,categorize,appearance,image,picture,classify',
            requirements={},
            #qualifications='{ "substance": 1 }',
            auto_add_hits=
            False,  # settings.MTURK_SANDBOX,  # TODO: get rid of fixed list
        )
Esempio n. 4
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    from mturk.utils import configure_experiment
    production = not settings.MTURK_SANDBOX

    configure_experiment(
        slug='intrinsic_opacity',
        template_dir='intrinsic/experiments',
        module='intrinsic.experiments',
        version=2,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.05'),
        num_outputs_max=5,
        contents_per_hit=200,  # if production else 50,
        frame_height=668,  # handle 1024x768 window sizes
        content_type_model=IntrinsicPoint,
        out_content_type_model=IntrinsicPointOpacityResponse,
        out_content_attr='point',
        content_filter={
            #'photo__license__publishable': True,
            #'photo__stylized': False,
            #'photo__rotated': False,
            #'photo__nonperspective': False,
            #'photo__synthetic': True,
            'photo__intrinsic_synthetic__multilayer_exr__isnull': False,
            #'photo__scene_category_correct': True,
            #'photo__num_intrinsic_points__gte': 20,
            #'min_separation__lt': 0.05,
        },
        title='Click on mirrors and transparent surfaces',
        description=
        'Given points in images, your job is to decide which belong to mirrors or transparent objects.',
        keywords='category,images,collection,image,picture,classify,color',
        requirements={},
        auto_add_hits=True,
        has_tutorial=True,
    )

    # don't add photo 10386; it's somewhat ambiguous
    # don't add photo 94610 -- it's all gloss and metal
    excluded_photo_ids = [10386, 94610]

    # hard-code examples here for now
    equal_tests = IntrinsicPointComparison.objects.in_bulk(
        list(
            set([
                961869,
                961802,
                961774,
                961815,
                961848,
                961789,
                961814,
                961888,
                961868,
                961885,
                961713,
                961742,
                961818,
                961813,
                961864,
                961807,
                961743,
                961766,
                961784,
                961884,
                961714,
                999517,
                999510,
                1006818,
                1006825,
                1006838,
                1006808,
                1006820,
                1006810,
                1046422,
                1046444,
                1046369,
                1046437,
                1046352,
                1046338,
                1046425,
                1046459,
                929022,
                929035,
                929037,
                929031,
                929008,
                928985,
                929006,
                929035,
                2385973,
                2386026,
                2385959,
                2386106,
                2385974,
                1605947,
                1605914,
                1605960,
                1605989,
                1605962,
                1606032,
                1605956,
                1605931,
                1605946,
                1605988,
                1606043,
                1606044,
                1118334,
                1118351,
                1118282,
                1118347,
                1118422,
                1118329,
                1118260,
                1118410,
                1118350,
                1118443,
                1118311,
                1118306,
                1118404,
                1118362,
                1118286,
                1118405,
                1118345,
                1118287,
                1118335,
                1118367,
                1118395,
                1118390,
                1118308,
                1118400,
                1118434,
                1118301,
                1118425,
                1118439,
                1118369,
                1118415,
                1118281,
                1118288,
                1118362,
                2419322,
                2419219,
                2419210,
                2419204,
                956745,
                956741,
                956641,
                928997,
                928997,
                928981,
                1720063,
                1720071,
                1719956,
                1719978,
                1720041,
                1720042,
                1719928,
                1720011,
                1719905,
                1719973,
                1720059,
                1719918,
                1720012,
                1720080,
                1719915,
                1720025,
                1719974,
                1719943,
                1719908,
                1719922,
                1720044,
                1720013,
                1402497,
                1402598,
                1402545,
                1719916,
                1719958,
                1720078,
                1720628,
                1720590,
                1720606,
                1720641,
                1320564,
                1320545,
                1320547,
                1320548,
                2432036,
                3708799,
                3445549,
                1118283,
                1118258,
                2508708,
                951758,
                951741,
                951662,
                951758,
                951717,
                951620,
                951712,
                951629,
            ]))).values()
    for comparison in equal_tests:
        if comparison.photo_id not in excluded_photo_ids:
            comparison.darker = 'E'
            comparison.darker_method = 'A'
            comparison.save()

    point1_tests = IntrinsicPointComparison.objects.in_bulk([
        961811, 961865, 961759, 999516, 999490, 999491, 999583, 999500, 999564,
        1046371, 2358770, 2358731, 1118331, 1118290, 1118263, 1118302, 2358729,
        2358731, 2358695, 1180756, 1180681, 1180720, 1180701, 1180673, 976878,
        976878, 999565, 1720053, 1719988, 1719951, 1402559, 1720077, 1720629,
        1320551, 1320549, 1320627, 1320606, 1320622, 2431927, 2432017, 2431952,
        2432053, 2431947, 2432055, 3708827, 3708860, 3708802, 3708808, 3708899,
        3708874, 3708845, 3445595, 3445598, 3445566, 3445584, 3445498, 3708895,
        3708908, 3708894, 3889277, 3889277, 3889172, 961827, 961769, 961891,
        961725, 961744, 2369862, 2369839, 2369873, 2508687, 2508663, 2508695,
        2508631
    ]).values()
    for comparison in point1_tests:
        if comparison.photo_id not in excluded_photo_ids:
            comparison.darker = '1'
            comparison.darker_method = 'A'
            comparison.save()

    point2_tests = IntrinsicPointComparison.objects.in_bulk([
        999515, 999498, 999499, 999569, 999562, 1046453, 2358755, 2358801,
        2358691, 1118365, 1118418, 2358714, 2358755, 956602, 956601, 1180669,
        1180730, 976827, 976825, 1719954, 1720019, 1402521, 1402562, 1720565,
        1320579, 2431925, 2431989, 2431923, 2432011, 3708773, 3708878, 3445472,
        3445554, 3445586, 3445550, 3445609, 3445556, 3445546, 3889199, 3889278,
        3889145, 2208252, 2369764, 2508705, 2508711
    ]).values()
    for comparison in point2_tests:
        if comparison.photo_id not in excluded_photo_ids:
            comparison.darker = '2'
            comparison.darker_method = 'A'
            comparison.save()

    test_contents = [
        t for t in (equal_tests + point1_tests + point2_tests)
        if t.photo_id not in excluded_photo_ids
    ]

    configure_experiment(
        slug='intrinsic_compare',
        template_dir='intrinsic/experiments',
        module='intrinsic.experiments',
        version=2,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.06'),
        num_outputs_max=5,
        contents_per_hit=25,  # if production else 2,
        max_active_hits=10000 if production else 50,
        frame_height=668,  # handle 1024x768 window sizes
        content_type_model=IntrinsicPointComparison,
        out_content_type_model=IntrinsicPointComparisonResponse,
        out_content_attr='comparison',
        content_filter={
            'point1__opaque': True,
            'point2__opaque': True,
            'photo__intrinsic_synthetic__multilayer_exr__isnull': False,
            #'photo__license__publishable': True,
            #'photo__stylized': False,
            #'photo__rotated': False,
            #'photo__nonperspective': False,
            #'photo__synthetic': False,
            #'photo__scene_category_correct': True,
            #'point1__min_separation__lt': 0.05,
        },
        title='Compare colors in an image',
        description=
        'Given pairs of points in images, your job is to decide which of two points is darker.',
        keywords='category,images,collection,image,picture,classify,color',
        requirements={},
        auto_add_hits=True,
        has_tutorial=True,
        test_contents=test_contents,
        test_contents_per_assignment=5,
    )
Esempio n. 5
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    # set up envmaps
    envmap = EnvironmentMap.objects.get_or_create(
        user=User.objects.get_or_create(
            username='******')[0].get_profile(),
        name='ennis')

    for envmap in EnvironmentMap.objects.all():
        configure_experiment(
            slug='bsdf_wd',
            template_dir='bsdfs/experiments',
            module='bsdfs.experiments',
            examples_group_attr='shape',
            variant={'envmap_id': envmap.id},
            version=1,  # 2: intrinsic images, 1: original opensurfaces
            reward=Decimal('0.10'),
            num_outputs_max=1,
            contents_per_hit=10,
            max_active_hits=2000,
            content_type_model=MaterialShape,
            out_content_type_model=ShapeBsdfLabel_wd,
            out_content_attr='shape',
            content_filter={
                #'synthetic': True,
                #'synthetic_slug__in': ['teapot', 'teacup', 'spoon', 'coyote'],
                'invalid': False,
                'pixel_area__gt': Shape.MIN_PIXEL_AREA,
                'num_vertices__gte': 10,
                'correct': True,
                'substance__isnull': False,
                'substance__fail': False,
                'photo__whitebalanced': True,
                'photo__scene_category_correct': True,
            },
            title='Adjust a blob to match an image',
            description='Looking at an image, your goal is to adjust the appearance '
                        'of a blob so that it matches a target photograph.  A modern '
                        'browser is required.',
            keywords='material,appearance,image,picture,classify,BRDF,microfacet,blob,appearance',
            frame_height=1150,
            requirements={},
            #qualifications='{ "bsdf_match": 1 }',
            auto_add_hits=False,  # settings.MTURK_SANDBOX,
        )

    for attr in ('color', 'gloss'):
        content_filter = {
            'invalid': False,
            'shape__invalid': False,
            'give_up': False,
            #'shape__pixel_area__gt': Shape.MIN_PIXEL_AREA,
            #'shape__correct': True,
            #'shape__substance__isnull': False,
            #'shape__substance__fail': False,
            #'shape__photo__whitebalanced': True,
            #'shape__photo__scene_category_correct': True,
        }
        if production and attr == 'gloss':
            content_filter['color_correct'] = True

        configure_experiment(
            slug='quality_bsdf_%s' % attr,
            template_dir='bsdfs/experiments',
            module='bsdfs.experiments',
            examples_group_attr='shape',
            variant={'bsdf_version': 'wd'},
            version=1,  # 2: intrinsic images, 1: original opensurfaces
            reward=Decimal('0.04'),
            num_outputs_max=5,
            contents_per_hit=40,
            content_type_model=ShapeBsdfLabel_wd,
            out_content_type_model=ShapeBsdfQuality,
            out_content_attr='shapebsdflabel_wd',
            content_filter=content_filter,
            title='Click on blobs that match an image (%s)' % attr,
            description='This task involves clicking on images that match a blob next to the image.',
            keywords='material,substance,shape,image,picture,classify,label,blob,match,appearance',
            #frame_height=7500,
            requirements={},
            auto_add_hits=False,  # settings.MTURK_SANDBOX,
        )
Esempio n. 6
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    configure_experiment(
        slug='segment_material',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.12'),
        num_outputs_max=6,
        out_count_ratio=6,
        contents_per_hit=1,
        max_active_hits=200,
        content_type_model=Photo,
        out_content_type_model=SubmittedShape,
        out_content_attr='photo',
        content_filter={
            'scene_category_correct': True,
            'license__creative_commons': True,
            'license__cc_no_deriv': False,
        },
        duration=60 * 60 * 3,
        title='Draw shapes in images',
        description='Draw polygons around regions that have the same material in a photograph.',
        keywords='material,substance,polygon,shape,draw,image,picture,classify',
        requirements={
            'min_shapes': 6,
            'min_vertices': 3
        },
        qualifications='{ "mat_seg": 1 }',
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='quality_material',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.04'),
        num_outputs_max=5 if production else 10,
        contents_per_hit=40,
        content_type_model=MaterialShape,
        out_content_attr='shape',
        out_content_type_model=MaterialShapeQuality,
        content_filter={
            'invalid': False,
            'correct__isnull': True,
            'pixel_area__gt': Shape.MIN_PIXEL_AREA,
            'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
        },
        title='Click on images that contain a single material',
        description='This task involves clicking on images that contain a single type of material or texture within a red boundary.',
        keywords='material,substance,shape,image,picture,classify,label',
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
        #examples_good=MaterialShape.objects.filter(
        #qualities__user=examples_user,
        #qualities__correct=True).order_by('?')[:200],
        #examples_bad=MaterialShape.objects.filter(
        #qualities__user=examples_user,
        #qualities__correct=False).order_by('?')[:200],
    )

    configure_experiment(
        slug='label_substance',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.10'),
        num_outputs_max=5,
        min_output_consensus=3,
        contents_per_hit=40,
        #max_active_hits=200,
        content_type_model=MaterialShape,
        out_content_type_model=ShapeSubstanceLabel,
        out_content_attr='shape',
        content_filter={
            'invalid': False,
            'correct': True,
            'pixel_area__gt': Shape.MIN_PIXEL_AREA,
            'num_vertices__gte': 4,
            #'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
        },
        title='Click on the name of a material in an image',
        description='Given a shape highlighted in an image, select its material from a list.',
        keywords='material,substance,appearance,image,picture,classify',
        frame_height=1200,
        requirements={},
        #qualifications='{ "substance": 1 }',
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='label_planarity',
        template_dir='shapes/experiments',
        module='shapes.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.04'),
        num_outputs_max=5 if production else 10,
        contents_per_hit=40,
        content_type_model=MaterialShape,
        out_content_type_model=ShapePlanarityLabel,
        out_content_attr='shape',
        content_filter={
            'invalid': False,
            'pixel_area__gt': Shape.MIN_PLANAR_AREA,
            'correct': True,
            'substance__isnull': False,
            'substance__fail': False,
            'num_vertices__gte': 4,
            #'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
        },
        title='Click on images of planar objects',
        description='Your task is to select the planar objects out of a collection of images.',
        keywords='flat,planar,appearance,polygon,shape,draw,image,picture,classify,label',
        #frame_height=7500,
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
        #examples_good=MaterialShape.objects.filter(
        #planarities__user=examples_user,
        #planarities__planar=True).order_by('?')[:200],
        #examples_bad=MaterialShape.objects.filter(
        #planarities__user=examples_user,
        #planarities__planar=False).order_by('?')[:200],
    )

    for group in ShapeSubstanceGroup.objects.filter(active=True):
        configure_experiment(
            slug='label_name',
            template_dir='shapes/experiments',
            module='shapes.experiments',
            examples_group_attr='shape',
            variant=json.dumps({'substance_group_id': group.id}),
            completed_id='label_name',
            version=1,  # 2: intrinsic images, 1: original opensurfaces
            reward=Decimal('0.10'),
            num_outputs_max=5,
            min_output_consensus=3,
            contents_per_hit=50,
            content_type_model=MaterialShape,
            out_content_type_model=MaterialShapeNameLabel,
            out_content_attr='shape',
            content_filter={
                'invalid': False,
                'pixel_area__gt': Shape.MIN_PIXEL_AREA,
                'correct': True,
                'substance__isnull': False,
                'substance__group_id': group.id,
                'photo__scene_category_correct': True,
                'num_vertices__gte': 4,
                #'photo__scene_category__name': 'kitchen',
            },
            frame_height=1200,
            title='Click on the name of an object in an image',
            description='Given an object highlighted in an image, select its common English name from a list. (id: %s)' % group.id,
            keywords='object,categorize,appearance,image,picture,classify',
            requirements={},
            #qualifications='{ "substance": 1 }',
            auto_add_hits=False,  # settings.MTURK_SANDBOX,  # TODO: get rid of fixed list
        )
Esempio n. 7
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    # full person annotation
    configure_experiment(
        slug='segment_person',
        variant='"person_fix"',
        template_dir='segmentation/experiments',
        module='segmentation.experiments',
        version=2,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.14'),
        num_outputs_max=1,
        contents_per_hit=2,
        content_type_model=PersonSegmentationTask,
        out_content_type_model=PersonSegmentation,
        out_content_attr='task',
        content_filter={
            'responses__isnull': True,
            'part__isnull': True,
        },
        title='Carefully segment a person',
        description=
        'Given an image, your job is to segment a person from an image.',
        keywords='person,images,segment',
        #frame_height=8000,
        requirements={},
        auto_add_hits=False,
        has_tutorial=True,
    )

    # part annotation
    configure_experiment(
        slug='segment_part_person',
        variant='',
        template_dir='segmentation/experiments',
        module='segmentation.experiments',
        version=2,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.11'),
        num_outputs_max=1,
        contents_per_hit=3,
        content_type_model=PersonSegmentationTask,
        out_content_type_model=PersonSegmentation,
        out_content_attr='task',
        content_filter={
            # only take tasks where we want to segment a part
            'part__isnull': False,
        },
        title='Carefully segment a part of a person',
        description='Given an image, your job is to segment a part of a person '
        + 'from an image.',
        keywords='person,part,images,segment',
        #frame_height=8000,
        requirements={},
        auto_add_hits=False,
        has_tutorial=True,
    )
Esempio n. 8
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    # aliases
    sandbox = settings.MTURK_SANDBOX
    production = not sandbox

    # set up envmaps
    envmap = EnvironmentMap.objects.get_or_create(
        user=User.objects.get_or_create(username="******")[0].get_profile(), name="ennis"
    )

    for envmap in EnvironmentMap.objects.all():
        configure_experiment(
            slug="bsdf_wd",
            template_dir="bsdfs/experiments",
            module="bsdfs.experiments",
            examples_group_attr="shape",
            variant={"envmap_id": envmap.id},
            version=1,  # 2: intrinsic images, 1: original opensurfaces
            reward=Decimal("0.10"),
            num_outputs_max=1,
            contents_per_hit=10,
            max_active_hits=2000,
            content_type_model=MaterialShape,
            out_content_type_model=ShapeBsdfLabel_wd,
            out_content_attr="shape",
            content_filter={
                #'synthetic': True,
                #'synthetic_slug__in': ['teapot', 'teacup', 'spoon', 'coyote'],
                "invalid": False,
                "pixel_area__gt": Shape.MIN_PIXEL_AREA,
                "num_vertices__gte": 10,
                "correct": True,
                "substance__isnull": False,
                "substance__fail": False,
                "photo__whitebalanced": True,
                "photo__scene_category_correct": True,
            },
            title="Adjust a blob to match an image",
            description="Looking at an image, your goal is to adjust the appearance "
            "of a blob so that it matches a target photograph.  A modern "
            "browser is required.",
            keywords="material,appearance,image,picture,classify,BRDF,microfacet,blob,appearance",
            frame_height=1150,
            requirements={},
            # qualifications='{ "bsdf_match": 1 }',
            auto_add_hits=False,  # settings.MTURK_SANDBOX,
        )

    for attr in ("color", "gloss"):
        content_filter = {
            "invalid": False,
            "shape__invalid": False,
            "give_up": False,
            #'shape__pixel_area__gt': Shape.MIN_PIXEL_AREA,
            #'shape__correct': True,
            #'shape__substance__isnull': False,
            #'shape__substance__fail': False,
            #'shape__photo__whitebalanced': True,
            #'shape__photo__scene_category_correct': True,
        }
        if production and attr == "gloss":
            content_filter["color_correct"] = True

        configure_experiment(
            slug="quality_bsdf_%s" % attr,
            template_dir="bsdfs/experiments",
            module="bsdfs.experiments",
            examples_group_attr="shape",
            variant={"bsdf_version": "wd"},
            version=1,  # 2: intrinsic images, 1: original opensurfaces
            reward=Decimal("0.04"),
            num_outputs_max=5,
            contents_per_hit=40,
            content_type_model=ShapeBsdfLabel_wd,
            out_content_type_model=ShapeBsdfQuality,
            out_content_attr="shapebsdflabel_wd",
            content_filter=content_filter,
            title="Click on blobs that match an image (%s)" % attr,
            description="This task involves clicking on images that match a blob next to the image.",
            keywords="material,substance,shape,image,picture,classify,label,blob,match,appearance",
            # frame_height=7500,
            requirements={},
            auto_add_hits=False,  # settings.MTURK_SANDBOX,
        )
Esempio n. 9
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    # must be imported locally to avoid a circular import
    from mturk.utils import configure_experiment

    configure_experiment(
        slug='rectify_continuous',
        template_dir='normals/experiments',
        module='normals.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.10'),
        num_outputs_max=1,
        contents_per_hit=10,
        content_type_model=MaterialShape,
        out_content_type_model=ShapeRectifiedNormalLabel,
        out_content_attr='shape',
        content_filter={
            'invalid': False,
            'planar': True,
            'pixel_area__gt': 10 * Shape.MIN_PLANAR_AREA,
            'num_vertices__gte': 4,
            'correct': True,
            'substance__isnull': False,
            'substance__fail': False,
            #'photo__whitebalanced': True,
            'photo__scene_category_correct': True,
            'photo__nonperspective': False,
        },
        title='Rotate an image in 3D',
        description='Rotate a thumbtack so that a 3D image looks like it is facing the camera.',
        keywords='flat,planar,appearance,polygon,shape,draw,image,picture,3D,graphics',
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )

    configure_experiment(
        slug='quality_rectify',
        template_dir='normals/experiments',
        module='normals.experiments',
        examples_group_attr='shape',
        version=1,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.04'),
        num_outputs_max=5,
        contents_per_hit=40,
        content_type_model=ShapeRectifiedNormalLabel,
        out_content_type_model=ShapeRectifiedNormalQuality,
        out_content_attr='rectified_normal',
        content_filter={
            'invalid': False,
            'shape__invalid': False,
            'shape__planar': True,
            #'shape__num_vertices__gte': 10,
            'shape__pixel_area__gt': 10 * Shape.MIN_PLANAR_AREA,
            #'automatic': True,
            #'shape__correct': True,
            #'shape__substance__isnull': False,
            #'shape__photo__whitebalanced': True,
            #'shape__photo__scene_category_correct': True,
        },
        title='Click on images that are correctly rotated',
        description='This task involves clicking on images that are correctly rotated.',
        keywords='material,substance,shape,image,picture,classify,label',
        #frame_height=7500,
        requirements={},
        auto_add_hits=False,  # settings.MTURK_SANDBOX,
    )
Esempio n. 10
0
def configure_experiments():
    """ This function is automatically called by
    the command ./manage.py mtconfigure """

    from mturk.utils import configure_experiment
    production = not settings.MTURK_SANDBOX

    configure_experiment(
        slug='intrinsic_opacity',
        template_dir='intrinsic/experiments',
        module='intrinsic.experiments',
        version=2,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.05'),
        num_outputs_max=5,
        contents_per_hit=200,   # if production else 50,
        frame_height=668,  # handle 1024x768 window sizes
        content_type_model=IntrinsicPoint,
        out_content_type_model=IntrinsicPointOpacityResponse,
        out_content_attr='point',
        content_filter={
            #'photo__license__publishable': True,
            #'photo__stylized': False,
            #'photo__rotated': False,
            #'photo__nonperspective': False,
            #'photo__synthetic': True,
            'photo__intrinsic_synthetic__multilayer_exr__isnull': False,
            #'photo__scene_category_correct': True,
            #'photo__num_intrinsic_points__gte': 20,
            #'min_separation__lt': 0.05,
        },
        title='Click on mirrors and transparent surfaces',
        description='Given points in images, your job is to decide which belong to mirrors or transparent objects.',
        keywords='category,images,collection,image,picture,classify,color',
        requirements={},
        auto_add_hits=True,
        has_tutorial=True,
    )

    # don't add photo 10386; it's somewhat ambiguous
    # don't add photo 94610 -- it's all gloss and metal
    excluded_photo_ids = [10386, 94610]

    # hard-code examples here for now
    equal_tests = IntrinsicPointComparison.objects.in_bulk(list(set([
        961869, 961802, 961774, 961815, 961848, 961789, 961814, 961888, 961868,
        961885, 961713, 961742, 961818, 961813, 961864, 961807, 961743, 961766,
        961784, 961884, 961714, 999517, 999510, 1006818, 1006825, 1006838,
        1006808, 1006820, 1006810, 1046422, 1046444, 1046369, 1046437, 1046352,
        1046338, 1046425, 1046459, 929022, 929035, 929037, 929031, 929008,
        928985, 929006, 929035, 2385973, 2386026, 2385959, 2386106, 2385974,
        1605947, 1605914, 1605960, 1605989, 1605962, 1606032, 1605956, 1605931,
        1605946, 1605988, 1606043, 1606044, 1118334, 1118351, 1118282, 1118347,
        1118422, 1118329, 1118260, 1118410, 1118350, 1118443, 1118311, 1118306,
        1118404, 1118362, 1118286, 1118405, 1118345, 1118287, 1118335, 1118367,
        1118395, 1118390, 1118308, 1118400, 1118434, 1118301, 1118425, 1118439,
        1118369, 1118415, 1118281, 1118288, 1118362, 2419322, 2419219, 2419210,
        2419204, 956745, 956741, 956641, 928997, 928997, 928981, 1720063,
        1720071, 1719956, 1719978, 1720041, 1720042, 1719928, 1720011, 1719905,
        1719973, 1720059, 1719918, 1720012, 1720080, 1719915, 1720025, 1719974,
        1719943, 1719908, 1719922, 1720044, 1720013, 1402497, 1402598, 1402545,
        1719916, 1719958, 1720078, 1720628, 1720590, 1720606, 1720641, 1320564,
        1320545, 1320547, 1320548, 2432036, 3708799, 3445549, 1118283, 1118258,
        2508708, 951758, 951741, 951662, 951758, 951717, 951620, 951712, 951629,
    ]))).values()
    for comparison in equal_tests:
        if comparison.photo_id not in excluded_photo_ids:
            comparison.darker = 'E'
            comparison.darker_method = 'A'
            comparison.save()

    point1_tests = IntrinsicPointComparison.objects.in_bulk([
        961811, 961865, 961759, 999516, 999490, 999491, 999583, 999500, 999564,
        1046371, 2358770, 2358731, 1118331, 1118290, 1118263, 1118302, 2358729,
        2358731, 2358695, 1180756, 1180681, 1180720, 1180701, 1180673, 976878,
        976878, 999565, 1720053, 1719988, 1719951, 1402559, 1720077, 1720629,
        1320551, 1320549, 1320627, 1320606, 1320622, 2431927, 2432017, 2431952,
        2432053, 2431947, 2432055, 3708827, 3708860, 3708802, 3708808, 3708899,
        3708874, 3708845, 3445595, 3445598, 3445566, 3445584, 3445498, 3708895,
        3708908, 3708894, 3889277, 3889277, 3889172, 961827, 961769, 961891,
        961725, 961744, 2369862, 2369839, 2369873, 2508687, 2508663, 2508695,
        2508631
    ]).values()
    for comparison in point1_tests:
        if comparison.photo_id not in excluded_photo_ids:
            comparison.darker = '1'
            comparison.darker_method = 'A'
            comparison.save()

    point2_tests = IntrinsicPointComparison.objects.in_bulk([
        999515, 999498, 999499, 999569, 999562, 1046453, 2358755, 2358801,
        2358691, 1118365, 1118418, 2358714, 2358755, 956602, 956601, 1180669,
        1180730, 976827, 976825, 1719954, 1720019, 1402521, 1402562, 1720565,
        1320579, 2431925, 2431989, 2431923, 2432011, 3708773, 3708878, 3445472,
        3445554, 3445586, 3445550, 3445609, 3445556, 3445546, 3889199, 3889278,
        3889145, 2208252, 2369764, 2508705, 2508711
    ]).values()
    for comparison in point2_tests:
        if comparison.photo_id not in excluded_photo_ids:
            comparison.darker = '2'
            comparison.darker_method = 'A'
            comparison.save()

    test_contents = [t for t in (equal_tests + point1_tests + point2_tests)
                     if t.photo_id not in excluded_photo_ids]

    configure_experiment(
        slug='intrinsic_compare',
        template_dir='intrinsic/experiments',
        module='intrinsic.experiments',
        version=2,  # 2: intrinsic images, 1: original opensurfaces
        reward=Decimal('0.06'),
        num_outputs_max=5,
        contents_per_hit=25,  # if production else 2,
        max_active_hits=10000 if production else 50,
        frame_height=668,  # handle 1024x768 window sizes
        content_type_model=IntrinsicPointComparison,
        out_content_type_model=IntrinsicPointComparisonResponse,
        out_content_attr='comparison',
        content_filter={
            'point1__opaque': True,
            'point2__opaque': True,
            'photo__intrinsic_synthetic__multilayer_exr__isnull': False,
            #'photo__license__publishable': True,
            #'photo__stylized': False,
            #'photo__rotated': False,
            #'photo__nonperspective': False,
            #'photo__synthetic': False,
            #'photo__scene_category_correct': True,
            #'point1__min_separation__lt': 0.05,
        },
        title='Compare colors in an image',
        description='Given pairs of points in images, your job is to decide which of two points is darker.',
        keywords='category,images,collection,image,picture,classify,color',
        requirements={},
        auto_add_hits=True,
        has_tutorial=True,
        test_contents=test_contents,
        test_contents_per_assignment=5,
    )