This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def cleanupPairs(pathh): | |
| import glob | |
| for i in glob.glob(pathh+'JPEGImages/'+'*png'): | |
| filename_split = os.path.splitext(i) | |
| filename_zero, fileext = filename_split | |
| basename = os.path.basename(filename_zero) | |
| if not os.path.isfile(pathh+'Annotations/'+basename+'.xml'): | |
| os.system('rm '+i) | |
| for i in glob.glob(pathh+'Annotations/'+'*xml'): | |
| filename_split = os.path.splitext(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from nltk.tokenize import sent_tokenize, word_tokenize | |
| from nltk.tokenize.treebank import TreebankWordDetokenizer | |
| import argparse | |
| #python sillylib.py --input bed button kill be black open clothes also | |
| # inspired by https://towardsdatascience.com/a-i-plays-mad-libs-and-the-results-are-terrifying-78fa44e7f04e | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--input',nargs='+',default=['bed','button','kill','be','black','open','clothes','even']) | |
| parser.add_argument('--person',default='AI') |
OlderNewer