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
class FeatureX(nn.Module): | |
def __init__(self): | |
super(FeatureX, self).__init__() | |
vgg19_model = models.vgg19(pretrained=True) | |
self.feature_extractor = nn.Sequential(*list(vgg19_model.features.children())[:18]) | |
def forward(self, img): | |
return self.feature_extractor(img) | |
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
# 1 | |
def weights_init_normal(m): | |
# 2 | |
def weights_init_xavier(m): | |
# 3 | |
def weights_init_kaiming(m): | |
# 4 | |
def weights_init_orthogonal(m): |
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
# save: | |
torch.save({ | |
'epoch': epoch, | |
'model_state_dict': model.state_dict(), | |
'optimizer_state_dict': optimizer.state_dict(), | |
'loss': loss, | |
... | |
}, PATH) |
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
const Scene = require('Scene'); | |
const Diagnostics = require('Diagnostics'); | |
const Instruction = require('Instruction'); | |
const CameraInfo = require('CameraInfo'); | |
const Time = require('Time'); | |
var instructionTimeloss; |
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
const Textures = require('Textures') | |
const Shaders = require('Shaders') | |
const R = require('Reactive') | |
const console = require('Diagnostics') | |
// get face material | |
const faceCameraMaterial = Materials.get('face0') | |
// get camera shader signal | |
const cameraColor = Textures.subTexture.get('Camera') | |
// get texture coords | |
const texc = Shaders.vertexAttribute({ variableName: Shaders.VertexAttribute.TEX_COORDS }) |
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
const Scene = require('Scene'); | |
const Animation = require('Animation'); | |
const R = require('Reactive'); | |
const TouchGestures = require('TouchGestures') | |
const Time = require('Time'); | |
const Materials = require('Materials'); | |
const Patches = require('Patches'); | |
var materialOpacity = 0.3; | |
var material1 = Materials.get('material1'); | |
var material2 = Materials.get('material2'); |
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
bl_info = { | |
'name': 'Drop to Ground', | |
'author': 'Unnikrishnan(kodemax), Florian Meyer(testscreenings)', | |
'version': (2,1.0), | |
'blender': (2, 8, 0), | |
'location': '3D View -> Tool Shelf -> Object Tools Panel (at the bottom)', | |
'description': 'Drop selected objects on active object', | |
'warning': 'Before using it do :- ctrl+a -> apply rotation on the object to be dropped', | |
'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.8', | |
'tracker_url': 'http://projects.blender.org/tracker/?func=detail&atid=25349', |
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
const CameraInfo = require('CameraInfo'); | |
const D = require('Diagnostics'); | |
CameraInfo.captureDevicePosition.monitor({fireOnInitialValue: true}).subscribe( function(e) { | |
D.log(e.newValue); | |
//Your IF statement can go here. | |
//Use if(e.newValue == "BACK"), etc | |
}); |
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
const Materials = require('Materials'); | |
const Textures = require('Textures'); | |
const Scene = require('Scene'); | |
const TouchGestures = require('TouchGestures'); | |
const Animation = require('Animation'); | |
// Locate the plane in the Scene | |
const plane = Scene.root.find('plane0'); | |
//animation has 5 frames and is imported into a material called "material0" | |
//Material0 is applied to plane0 in the scene |
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
var Scene = require('Scene'); | |
var FaceTracking = require('FaceTracking'); | |
var faceSignalX = FaceTracking.face(0).cameraTransform.x.expSmooth(100); | |
var faceSignalX2 = FaceTracking.face(0).cameraTransform.x.expSmooth(80); | |
var faceSignalY = FaceTracking.face(0).cameraTransform.y.expSmooth(80); | |
var faceSignalY2 = FaceTracking.face(0).cameraTransform.y.expSmooth(90); | |