We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa697ac commit 5aedfa6Copy full SHA for 5aedfa6
1 file changed
demos/video/style-transfer/neural_style_dev_server_working_2.py
@@ -53,9 +53,15 @@ def check_paths(args):
53
print(e)
54
sys.exit(1)
55
56
+import math
57
+def to_sci_not(x):
58
+ exp = math.floor(math.log10(abs(x)))
59
+ multiplier = 10 ** exp
60
+ return (x / multiplier), exp
61
+
62
def get_file_name(args):
- style_name = os.path.splitext(os.path.basename(args.style_image))[0]
- return f'{args.style_image}_ep{args.epochs}_bt{args.batch_size}_sw{args.style_weight}_cw_{args.content_weight}'
63
+ base_name,_ = os.path.splitext(os.path.basename(args.style_image))
64
+ return f'{base_name}_ep{args.epochs}_bt{args.batch_size}_sw{to_sci_not(args.style_weight)}_cw_{to_sci_not(args.content_weight)}'
65
66
def train(args):
67
if args.accel:
0 commit comments