{"id":115,"date":"2022-04-20T14:52:38","date_gmt":"2022-04-20T05:52:38","guid":{"rendered":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/?p=115"},"modified":"2022-04-20T16:18:34","modified_gmt":"2022-04-20T07:18:34","slug":"4-20-%e9%80%b2%e6%8d%97%e5%a0%b1%e5%91%8a","status":"publish","type":"post","link":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/2022\/04\/20\/4-20-%e9%80%b2%e6%8d%97%e5%a0%b1%e5%91%8a\/","title":{"rendered":"4\/20 \u9032\u6357\u5831\u544a"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Web\u4e0a\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u52d5\u753b\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/h1>\n\n\n\n<p>Web\u4e0a\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u52d5\u753b\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u3044\u305f\u3068\u3053\u308d\u3001Streamlit\u3068\u3044\u3046Python\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u898b\u3064\u3051\u307e\u3057\u305f\u3002\u30c7\u30fc\u30bf\u5206\u6790\u3084AI\u51e6\u7406\u306a\u3069\u306e\u30b3\u30fc\u30c9\u3092\u7c21\u5358\u306bWeb\u30a2\u30d7\u30ea\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001Web\u4e0a\u3067\u306e\u52d5\u753b\u8868\u793a\u3082\u53ef\u80fd\u3060\u3063\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u52d5\u304b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Streamlit<\/h1>\n\n\n\n<p> \u2460\u52d5\u753b\u8868\u793a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#test.py\n\nimport streamlit as st\nfrom streamlit_webrtc import webrtc_streamer\n\nst.title(\"Test app\")\n\nwebrtc_streamer(key=\"test\")<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-content\/uploads\/sites\/128\/2022\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-04-20-14.27.03.png\" alt=\"\" class=\"wp-image-116\" width=\"346\" height=\"313\" srcset=\"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-content\/uploads\/sites\/128\/2022\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-04-20-14.27.03.png 640w, https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-content\/uploads\/sites\/128\/2022\/04\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-04-20-14.27.03-300x272.png 300w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\" \/>\n\n\n\n<p>\u2461\u30d5\u30a3\u30eb\u30bf\u3092\u52a0\u3048\u3066\u52d5\u753b\u8868\u793a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#test2.py\n\nimport streamlit as st\nfrom streamlit_webrtc import webrtc_streamer\nimport av\nimport cv2\n\nst.title(\"Test app\")\n\nclass VideoProcessor:\n    def __init__(self) -&gt; None:\n        self.threshold1 = 100\n        self.threshold2 = 200\n\n    def recv(self, frame):\n        img = frame.to_ndarray(format=\"bgr24\")\n\n        img = cv2.cvtColor(cv2.Canny(img, self.threshold1, self.threshold2), cv2.COLOR_GRAY2BGR)\n\n        return av.VideoFrame.from_ndarray(img, format=\"bgr24\")\n\n\nctx = webrtc_streamer(key=\"example\", video_processor_factory=VideoProcessor)\nif ctx.video_processor:\n    ctx.video_processor.threshold1 = st.slider(\"Threshold1\", min_value=0, max_value=1000, step=1, value=100)\n    ctx.video_processor.threshold2 = st.slider(\"Threshold2\", min_value=0, max_value=1000, step=1, value=200)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-content\/uploads\/sites\/128\/2022\/04\/image.png\" alt=\"\" class=\"wp-image-118\" width=\"346\" height=\"364\" srcset=\"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-content\/uploads\/sites\/128\/2022\/04\/image.png 609w, https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-content\/uploads\/sites\/128\/2022\/04\/image-285x300.png 285w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/figure>\n\n\n\n<p>\u301c\u307e\u3068\u3081\u301c<br>\u666e\u901a\u306e\u52d5\u753b\u3060\u3051\u3067\u306a\u304f\u753b\u50cf\u51e6\u7406\u3092\u3057\u306a\u304c\u3089\u306e\u52d5\u753b\u306e\u8868\u793a\u3082\u3067\u304d\u305f\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u6b21\u56de\u307e\u3067\u306b\u3084\u308b\u3053\u3068<\/h1>\n\n\n\n<p>MediaPipe\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u5148\u8f29\u306e\u30b3\u30fc\u30c9\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3068\u52d5\u4f5c\u78ba\u8a8d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u4e0a\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u52d5\u753b\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066 Web\u4e0a\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u52d5\u753b\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u3044\u305f\u3068\u3053\u308d\u3001Streamlit\u3068\u3044\u3046Python\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u898b\u3064\u3051\u307e\u3057\u305f\u3002\u30c7\u30fc\u30bf\u5206\u6790\u3084AI\u51e6\u7406\u306a\u3069\u306e\u30b3\u30fc\u30c9\u3092\u7c21 [&hellip;]<\/p>\n","protected":false},"author":130,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-115","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/posts\/115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/users\/130"}],"replies":[{"embeddable":true,"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/comments?post=115"}],"version-history":[{"count":2,"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/posts\/115\/revisions"}],"predecessor-version":[{"id":121,"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/posts\/115\/revisions\/121"}],"wp:attachment":[{"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/media?parent=115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/categories?post=115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mm-lab.aitech.ac.jp\/k19094\/wp-json\/wp\/v2\/tags?post=115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}