diff --git a/ebay_api.py b/ebay_api.py index db5954c..39979ef 100644 --- a/ebay_api.py +++ b/ebay_api.py @@ -404,13 +404,18 @@ class PreProcessing: splits, etc. ''' - def stt_training(self, dict_pics, expanded_class, expanded_dropd): + def stt_training(self): ''' Source to target training. Replaces source image URL with target URL determined by values in dict_pics variable. ''' - pass + target_dir = os.getcwd() + with open('temp_pics_source_list.txt') as f: + temp_pics_source_list = json.load(f) + temp_dict_pics = {k:target_dir + os.sep + re.search(r'[^/]+(?=/\$_|.jpg)', k, re.IGNORECASE).group() + '.jpg' for k in temp_pics_source_list} + print("{source:target} dictionary created @ " + os.getcwd() + os.sep + 'training_images') + return temp_dict_pics # TODO pipeline gameplan: 5 files: dict_pics.txt,raw_json.txt, raw_json.csv, expanded_class.csv, expanded_dropd.csv # cont... open raw_json.txt and append, same with csv --> process new data --> pull out image source+dest and expand new dfs for the additional pictures