Advertisement
Guest User

add_to_queue.py

a guest
Jul 3rd, 2021
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. import os
  2. import sys
  3.  
  4. usingBat=1
  5.  
  6. if sys.argv[0]!="" and len(sys.argv)!=3:
  7.  input("Drag and drop image and video")
  8.  exit()
  9.  
  10. file=os.path.dirname(sys.argv[0])+"\\queue.bat"
  11. output_file=f"{os.path.splitext(os.path.basename(sys.argv[1]))[0]}_{os.path.basename(sys.argv[2])}"
  12. with open(file,"a") as f:
  13.  if os.path.getsize(file) < 2:
  14.   if not usingBat:
  15.    f.write("cd ..\n")
  16.   f.write("echo break^>\"%%~f0\">>\"%~f0\"\n")
  17.  if usingBat:
  18.   f.write("drop_here_to_edit.py \"{0}\" \"{1}\"\n".format(sys.argv[1],sys.argv[2]))
  19.  else:
  20.   f.write("python test_video_swapsingle.py --isTrain false --name people --Arc_path arcface_model/arcface_checkpoint.tar --pic_a_path \"{0}\" --video_path \"{1}\" --output_path \"./output/{2}\" --temp_path ./temp_results\n".format(sys.argv[1],sys.argv[2],output_file))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement