Ejemplo n.º 1
0
    def _download(self, root_dir, version='feature'):
        assert version in self.__valid_versions
        if not os.path.isdir(root_dir):
            os.makedirs(root_dir)
        elif os.path.isfile(os.path.join(root_dir, 'data.csv')):
            df = pd.read_csv(os.path.join(root_dir, 'data.csv'))
            streaming_logs = df.to_dict(orient='list')
            if all([
                    os.path.isfile(os.path.join(root_dir, 'streaming_logs', s))
                    for s in streaming_logs['streaming_log']
            ]):
                print('WaterlooSQoE-III already downloaded.')
                return

        url = 'http://ivc.uwaterloo.ca/database/WaterlooSQoE-III/'
        if version == 'full':
            filename = 'waterloo_sqoe3_full.zip'
            url += filename
        elif version == 'feature':
            filename = 'waterloo_sqoe3_feature.zip'
            url += filename
        else:
            filename = 'waterloo_sqoe3_server_video.zip'
            url += filename

        zip_filename = os.path.join(root_dir, filename)
        if not os.path.isfile(zip_filename):
            print('Downloading WaterlooSQoE-III database...\n')
            download(url, zip_filename)
            print('WaterlooSQoE-III database download complete!\n')

        # extract zip
        extract(zip_filename, root_dir)
Ejemplo n.º 2
0
    def _download(self, root_dir, version='feature'):
        assert version in self.__valid_versions
        if not os.path.isdir(root_dir):
            os.makedirs(root_dir)
        elif os.path.isfile(os.path.join(root_dir, 'data.csv')):
            df = pd.read_csv(os.path.join(root_dir, 'data.csv'))
            streaming_logs = df.to_dict(orient='list')
            if all([
                    os.path.isfile(os.path.join(root_dir, 'streaming_logs', s))
                    for s in streaming_logs['streaming_log']
            ]):
                print('LIVE-NFLX-I already downloaded.')
                return

        url = 'http://ivc.uwaterloo.ca/database/LIVENFLX1/'
        filename = 'live_nflx1_feature.zip'
        url += filename

        zip_filename = os.path.join(root_dir, filename)
        if not os.path.isfile(zip_filename):
            print('Downloading LIVE-NFLX-I database...\n')
            download(url, zip_filename)
            print('LIVE-NFLX-I database download complete!\n')

        # extract zip
        extract(zip_filename, root_dir)