コード例 #1
0
ファイル: sentinel_images.py プロジェクト: WFP-VAM/HRM
    def __init__(self, directory):
        DataSource.__init__(self, directory)
        """ Overload the directory path. """
        self.directory = os.path.join(self.directory, 'Sentinel/')
        if not os.path.exists(self.directory):
            os.makedirs(self.directory)
        """ loads the model. """
        print("INFO: downloading model. ")
        with requests.get(
                'https://s3.eu-central-1.amazonaws.com/hrm-models/{}'.format(
                    MODEL),
                stream=True) as r:
            with open('../Models/{}'.format(MODEL), 'wb') as f:
                f.write(r.content)
        #s3_download('hrm-models', MODEL, '../Models/{}'.format(MODEL))

        print("INFO: loading model for Sentinel Images ...")
        self.net = tf.keras.models.load_model('../Models/{}'.format(MODEL),
                                              compile=False)
        self.net = tf.keras.models.Model(
            inputs=self.net.input, outputs=self.net.get_layer(LAYER).output)
コード例 #2
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.content_type = 'video'
     self.tags = ['technology/technology']
     self.show_elements = 'video'
     self.show_atoms = 'media'
コード例 #3
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.tags = ['news/series/the-long-read,-tone/audio,-type/audio']
コード例 #4
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.content_type = 'gallery'
     self.tags = ['childrens-books-site/series/how-to-draw']
     self.show_elements = 'image'
コード例 #5
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.content_type = 'video'
     self.tags = ['technology/technology']
     self.show_elements = 'video'
コード例 #6
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.content_type = 'video'
     self.tags = ['theguardian/series/how-to-dress']
     # self.page_size = 1
     self.show_elements = 'video'
コード例 #7
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.tags = ['fashion/series/stylewatch']
     # self.page_size = 1
     self.show_elements = 'image'
コード例 #8
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.content_type = 'video'
     self.tags = ['theguardian/series/how-to-dress']
     # self.page_size = 1
     self.show_elements = 'video'
コード例 #9
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.content_type = 'gallery'
     self.tags = ['(fashion/series/fashion-for-all-ages|fashion/series/key-fashion-trends-of-the-season|fashion/series/fashion-line-up)']
     # self.page_size = 1
     self.show_elements = 'image'
コード例 #10
0
 def __init__(self, client):
     DataSource.__init__(self, client)
     self.tags = ['fashion/series/stylewatch']
     # self.page_size = 1
     self.show_elements = 'image'