test_views.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:Fabrik 作者: Cloud-CV 项目源码 文件源码
def test_caffe_import(self):
        top = L.SPP(pyramid_height=2, pool=1)
        with open(os.path.join(settings.BASE_DIR, 'media', 'test.prototxt'), 'w') as f:
            f.write(str(to_proto(top)))
        sample_file = open(os.path.join(settings.BASE_DIR, 'media', 'test.prototxt'), 'r')
        response = self.client.post(reverse('caffe-import'), {'file': sample_file})
        response = json.loads(response.content)
        os.remove(os.path.join(settings.BASE_DIR, 'media', 'test.prototxt'))
        self.assertGreaterEqual(len(response['net']['l0']['params']), 2)
        self.assertEqual(response['result'], 'success')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号