REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47
AppleScript is a rather peculiar scripting language to learn.
// Transform > Position > Code | |
var composition_width = thisComp.width; | |
var composition_height = thisComp.height; | |
var x_value = composition_width / 2; | |
var y_value = composition_height / 2; | |
[x_value, y_value]; |
// Transform > Anchor Point > Code | |
var object_layer = thisComp.layer("Controller"); | |
var object_rectangle = object_layer.sourceRectAtTime(); | |
var object_left = object_rectangle.left; | |
var object_top = object_rectangle.top; | |
var object_width = object_rectangle.width; | |
var object_height = object_rectangle.height; | |
var x_value = object_left + (object_width / 2); | |
var y_value = object_top + (object_height / 2); |
// Transform > Anchor Point > Code | |
var text_rectangle = thisLayer.sourceRectAtTime(time, false); | |
var text_left = text_rectangle.left; | |
var text_top = text_rectangle.top; | |
var text_width = text_rectangle.width; | |
var text_height = text_rectangle.height; | |
var x_value = text_left; | |
var y_value = text_top + text_height; | |
[x_value, y_value]; |
// Contents > Rectangle > Rectangle Path > Shape > Code | |
var padding_value = thisComp.layer("Controller").effect("Padding")("Slider"); | |
var text_layer = thisComp.layer("Subtitle"); | |
var text_rectangle = text_layer.sourceRectAtTime(); | |
var text_width = text_rectangle.width; | |
var text_height = text_rectangle.height; | |
var text_background_width = text_width + (padding_value * 2); | |
var text_background_height = text_height + (padding_value * 2); | |
[text_background_width, text_background_height]; |
// Transform > Position > Code | |
var text_composition = comp("Top"); | |
var text_layer = text_composition.layer("Subtitle"); | |
var text_rectangle = text_layer.sourceRectAtTime(); | |
var text_left = text_rectangle.left; | |
var text_top = text_rectangle.top; | |
var text_width = text_rectangle.width; | |
var text_height = text_rectangle.height; |
# sets user to default user for web server | |
user www-data; | |
# sets number of cpu cores to use | |
worker_processes auto; | |
# customizes how to handle connections | |
events { | |
# sets number of connections to use per cpu core |
from fastai.vision.all import * | |
from fastbook import * | |
file_directory = untar_data(URLs.MNIST_SAMPLE) | |
training_3_file_paths = (file_directory/'train'/'3').ls().sorted() | |
training_3_tensors = [tensor(Image.open(file_path)) for file_path in training_3_file_paths] | |
training_3_tensors = torch.stack(training_3_tensors).float() / 255 | |
training_7_file_paths = (file_directory/'train'/'7').ls().sorted() | |
training_7_tensors = [tensor(Image.open(file_path)) for file_path in training_7_file_paths] |
parser = argparse.ArgumentParser(description='DSFD:Dual Shot Face Detector') | |
parser.add_argument('--trained_model', default='weights/WIDERFace_DSFD_RES152.pth', | |
type=str, help='Trained state_dict file path to open') | |
parser.add_argument('--save_folder', default='eval_tools/', type=str, | |
help='Dir to save results') | |
parser.add_argument('--visual_threshold', default=0.1, type=float, | |
help='Final confidence threshold') | |
parser.add_argument('--cuda', default=False, type=bool, | |
help='Use cuda to train model') |