예제 #1
0
파일: views.py 프로젝트: zys7832/sms
def validator(request,path,field):
    model = loader.load_model(path)
    value = request.REQUEST.get(field)
    q = db_models.Q()
    q.children.append((field,value))
    count = model.objects.filter(q).count()
    #return http.HttpResponse(u"true")
    return http.HttpResponse(u"true" if count==0 else u"false")
예제 #2
0
 def __init__(self, modelpath, meanpath, gpu=-1):
    model = loader.load_model(modelpath)
    super(ModelVisualizer, self).__init__(meanpath, model, gpu)
    self.gpu = gpu
    if self.gpu >= 0:
       cuda.init(self.gpu)
예제 #3
0
 def __init__(self, modelpath, meanpath, gpu=-1):
    model = loader.load_model(modelpath)
    super(Detector, self).__init__(meanpath, model, gpu)
예제 #4
0
 def test_load_model1(self):
    """ load_model case1: simply call the method. """
    filepath = os.path.join(self.root, 'model.dump')
    loader.load_model(filepath)