4198bff
user_wwq 3 years ago
2 changed file(s) with 46 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
22 {
33 "cell_type": "code",
44 "execution_count": 3,
5 "id": "db0b0a11",
5 "id": "769c9afd",
66 "metadata": {},
77 "outputs": [
88 {
3939 {
4040 "cell_type": "code",
4141 "execution_count": 4,
42 "id": "377355df",
42 "id": "227c58c5",
4343 "metadata": {},
4444 "outputs": [],
4545 "source": [
4848 },
4949 {
5050 "cell_type": "code",
51 "execution_count": 9,
52 "id": "dc65195f",
53 "metadata": {},
54 "outputs": [],
55 "source": [
56 "import time\n",
57 "def run_time(func):\n",
58 " def inner(model, image, question):\n",
59 " back = func(model, image, question)\n",
60 " print(\"Runned time: {} s\".format(round((time.time() - t)/10, 3)))\n",
61 " return back\n",
62 " t = time.time()\n",
63 " return inner"
64 ]
65 },
66 {
67 "cell_type": "code",
5168 "execution_count": 8,
52 "id": "fd4ec8ee",
69 "id": "bcbe551f",
5370 "metadata": {},
5471 "outputs": [],
5572 "source": [
6279 {
6380 "cell_type": "code",
6481 "execution_count": 6,
65 "id": "cc76d61f",
82 "id": "36fcb0d9",
6683 "metadata": {},
6784 "outputs": [],
6885 "source": [
86 "@run_time\n",
6987 "def inference(model_PATH, img_p):\n",
7088 " G_Z = tf.placeholder(tf.float32, shape=[None, IMAGE_SZ, IMAGE_SZ, 4], name='G_Z')\n",
7189 " G_sample = model.generator(G_Z)\n",
83101 {
84102 "cell_type": "code",
85103 "execution_count": null,
86 "id": "d93edf59",
104 "id": "b79deb86",
87105 "metadata": {},
88106 "outputs": [],
89107 "source": [
22 {
33 "cell_type": "code",
44 "execution_count": 3,
5 "id": "ea42a489",
5 "id": "3c86ef8a",
66 "metadata": {},
77 "outputs": [
88 {
3939 {
4040 "cell_type": "code",
4141 "execution_count": 4,
42 "id": "24a28be9",
42 "id": "87b58a5a",
4343 "metadata": {},
4444 "outputs": [],
4545 "source": [
4848 },
4949 {
5050 "cell_type": "code",
51 "execution_count": 9,
52 "id": "4e963aed",
53 "metadata": {},
54 "outputs": [],
55 "source": [
56 "import time\n",
57 "def run_time(func):\n",
58 " def inner(model, image, question):\n",
59 " back = func(model, image, question)\n",
60 " print(\"Runned time: {} s\".format(round((time.time() - t)/10, 3)))\n",
61 " return back\n",
62 " t = time.time()\n",
63 " return inner"
64 ]
65 },
66 {
67 "cell_type": "code",
5168 "execution_count": 8,
52 "id": "2f04ed3d",
69 "id": "aba8e440",
5370 "metadata": {},
5471 "outputs": [],
5572 "source": [
6279 {
6380 "cell_type": "code",
6481 "execution_count": 6,
65 "id": "4cc717e4",
82 "id": "bc8c0bf4",
6683 "metadata": {},
6784 "outputs": [],
6885 "source": [
86 "@run_time\n",
6987 "def inference(model_PATH, img_p):\n",
7088 " G_Z = tf.placeholder(tf.float32, shape=[None, IMAGE_SZ, IMAGE_SZ, 4], name='G_Z')\n",
7189 " G_sample = model.generator(G_Z)\n",
83101 {
84102 "cell_type": "code",
85103 "execution_count": null,
86 "id": "9ce2fc25",
104 "id": "5c1557b3",
87105 "metadata": {},
88106 "outputs": [],
89107 "source": [