コード例 #1
0
        hsv = hsv_from_lab(lab)
        hsl = hsl_from_lab(lab)
        return (hex, lab, hsv, hsl)

    def transform(self):
        pass

    def load(self):
        pass


if __name__ == '__main__':

    args = Arguments(description='a script to extract color information from '
                     'film stills and create a color cube to determine '
                     'the dominant colors. '
                     'You can pass a director name. '
                     'If no director name '
                     'is passed, the script defaults to all directors.')

    args.add_argument(
        '--director',
        help='a single director name',
    )

    director = args.get('--director', None)
    directors = list()

    if not director:
        directors = [
            'christopher_nolan',
            'coen_brothers',
コード例 #2
0
        lab = lab_from_rgb((r, g, b))
        hsv = hsv_from_lab(lab)
        hsl = hsl_from_lab(lab)
        return (r, g, b, lab, hsv, hsl)

    def transform(self):
        pass

    def load(self):
        pass

if __name__ == '__main__':

    args = Arguments(description='a script to upload images to tineye labs'
                                 'and scrape extracted color information. '
                                 'You can pass a director name. '
                                 'If no director name '
                                 'is passed, the script defaults to all directors.')

    args.add_argument(
        '--director',
        help='a single director name',
    )

    director = args.get('--director', None)

    if not director:
        directors = ['christopher_nolan',
                     'coen_brothers',
                     'david_lynch',
                     'francis_ford_coppola',
コード例 #3
0
                                   sample_path=image)

    def transform(self):
        self.neural_net.process()
        save_network_to_xml(net=None, file_name=None)

    def load(self):
        save_row(file=self.file,
                 row=[self.neural_net.cross_validation_result,
                      self.neural_net.test_result,
                      self.neural_net.train_result])


if __name__ == '__main__':

    args = Arguments(description='a script to extract properties from '
                                 'film stills for use in a neural network. '
                                 'You can pass a director name. '
                                 'If no director name '
                                 'is passed, the script defaults to all directors.')

    directors = {'christopher_nolan': 0,
                 'coen_brothers': 1,
                 'david_lynch': 2,
                 'spike_jonze': 3,
                 'wes_anderson': 4,}

    workflow = NeuralNetWorkflow(directors=directors)

    workflow.process()
コード例 #4
0
        lab = lab_from_rgb((r, g, b))
        hsv = hsv_from_lab(lab)
        hsl = hsl_from_lab(lab)
        return (r, g, b, hex, lab, hsv, hsl)

    def transform(self):
        pass

    def load(self):
        pass

if __name__ == '__main__':

    args = Arguments(description='a script to extract color information '
                                 'from film stills and determine dominant '
                                 'colors with k-means clustering. '
                                 'You can pass a director name. '
                                 'If no director name '
                                 'is passed, the script defaults to all directors.')

    args.add_argument(
        '--director',
        help='a single director name',
    )

    args.add_argument(
        '--num_clusters',
        help='an integer value that '
             'represents the number of clusters',
        type=int
    )
    director = args.get('--director', None)