added separate dict_pics function for changing target training images url on the fly

This commit is contained in:
spbeach46 2021-12-17 22:26:55 -07:00
parent 2f3df22c4a
commit b349d2f07a

View File

@ -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