{"cells":[{"metadata":{"trusted":true},"cell_type":"code","source":"import cv2\nimport json\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Description\nYour smartphone goes everywhere with you—whether driving to the grocery store or shopping for holiday gifts. With your permission, apps can use your location to provide contextual information. You might get driving directions, find a store, or receive alerts for nearby promotions. These handy features are enabled by GPS, which requires outdoor exposure for the best accuracy. Yet, there are many times when you’re inside large structures, such as a shopping mall or event center. Accurate indoor positioning, based on public sensors and user permission, allows for a great location-based experience even when you aren’t outside.\n\n> 食料品店に車で行く場合でも、ホリデーギフトを買う場合でも、  \nスマートフォンはどこにでも持ち運びできます。  \nあなたの許可があれば、アプリはあなたの場所を使用してコンテキスト情報を提供できます。  運転ルートを取得したり、お店を見つけたり、  \n近くのプロモーションのアラートを受け取ったりする場合があります。  \nこれらの便利な機能はGPSによって有効になり、  \n最高の精度を得るには屋外での露出が必要です。  \nそれでも、ショッピングモールやイベントセンターなどの大きな建物の中にいることはよくあります。  \n公共のセンサーとユーザーの許可に基づく正確な屋内測位により、  \n外出していないときでも、優れたロケーションベースのエクスペリエンスが可能になります。\n\nCurrent positioning solutions have poor accuracy, particularly in multi-level buildings, or generalize poorly to small datasets. Additionally, GPS was built for a time before smartphones. Today’s use cases often require more granularity than is typically available indoors.\n\n> 現在の測位ソリューションは、特にマルチレベルの建物では精度が低いか、  \n小さなデータセットへの一般化が不十分です。  \nさらに、GPSはスマートフォンよりも前に構築されました。  \n今日のユースケースでは、通常、屋内で利用できるよりも細かい粒度が必要になることがよくあります。\n\nIn this competition, your task is to predict the indoor position of smartphones based on real-time sensor data, provided by indoor positioning technology company XYZ10 in partnership with Microsoft Research. You'll locate devices using “active” localization data, which is made available with the cooperation of the user. Unlike passive localization methods (e.g. radar, camera), the data provided for this competition requires explicit user permission. You'll work with a dataset of nearly 30,000 traces from over 200 buildings.\n\n> このコンテストでは、M**icrosoft Researchと提携して屋内測位技術会社XYZ10から提供されたリアルタイムのセンサーデータに基づいて、スマートフォンの屋内位置を予測することがあなたの仕事です**。  \nユーザーの協力を得て利用できる「アクティブな」ローカリゼーションデータを使用して、デバイスを特定します。  \nパッシブローカリゼーション方法（レーダー、カメラなど）とは異なり、このコンテストで提供されるデータには、明示的なユーザー許可が必要です。   \n200を超える建物からの約30,000のトレースのデータセットを使用します。\n\nIf successful, you’ll contribute to research with broad-reaching possibilities, including industries like manufacturing, retail, and autonomous devices. With more accurate positioning, existing location-based apps could even be improved. Perhaps you’ll even see the benefits yourself the next time you hit the mall.\n\n> 成功すれば、製造、小売、自律型デバイスなどの業界を含む、幅広い可能性を秘めた研究に貢献できます。  \nより正確なポジショニングにより、既存のロケーションベースのアプリをさらに改善することができます。  \nおそらく、次にモールに行くときに、自分でメリットを確認することもできます。"},{"metadata":{},"cell_type":"markdown","source":"# Data\nThe dataset for this competition consists of dense indoor signatures of WiFi, geomagnetic field, iBeacons etc., as well as ground truth (waypoint) (locations) collected from hundreds of buildings in Chinese cities. The data found in path trace files (*.txt) corresponds to an indoor path between position p_1 and p_2 walked by a site-surveyor.\n\n> このコンテストのデータセットは、WiFi、地磁気、iBeaconsなどの密集した屋内署名と、中国の都市の何百もの建物から収集されたグラウンドトゥルース（ウェイポイント）（場所）で構成されています。  \nパストレースファイル（* .txt）にあるデータは、サイトサーベイヤーが歩いた位置p_1とp_2の間の屋内パスに対応しています。\n\nDuring the walk, an Android smartphone is held flat in front of the surveyors body, and a sensor data recording app is running on the device to collect IMU (accelerometer, gyroscope) and geomagnetic field (magnetometer) readings, as well as WiFi and Bluetooth iBeacon scanning results. A detailed description of the format of trace file is shown, along with other details and processing scripts, at this github link. In addition to raw trace files, floor plan metadata (e.g., raster image, size, GeoJSON) are also included for each floor.\n\n> 歩行中、Androidスマートフォンは調査員の体の前で平らに保持され、センサーデータ記録アプリがデバイス上で実行されてIMU（加速度計、ジャイロスコープ）と地磁気（磁力計）の読み取り値、WiFiとBluetoothを収集しますiBeaconスキャン結果。  \nトレースファイルの形式の詳細な説明は、他の詳細および処理スクリプトとともに、このgithubリンクに表示されます。  \n生のトレースファイルに加えて、フロアプランのメタデータ（ラスターイメージ、サイズ、GeoJSONなど）も各フロアに含まれています。\n\nA note on data quality: In the training files, you may find occasionally that a line is missing the ending newline character, causing it to run on to the next line. It is up to you how you want to handle this issue. This issue is not found in the test data.\n\n> データ品質に関する注意：トレーニングファイルで、行の末尾の改行文字が欠落しているために、次の行に実行される場合があります。  \nこの問題をどのように処理するかはあなた次第です。この問題は、テストデータにはありません。"},{"metadata":{},"cell_type":"markdown","source":"# Files\n\n|    |    |\n|----|----|\n|train | training path files, organized by site and floor; each path files contains the data of a single path on a single floor|\n|test | test path files, organized by site and floor; each path files contains the data of a single path on a single floor, but without the waypoint (x, y) data; the task of this competition is, for a given site-path file, predict the floor and waypoint locations at the timestamps given in the sample_submission.csv file|\n|metadata | floor metadata folder, organized by site and floor, which includes the following for each floor:|\n||floor_image.png|\n||floor_info.json|\n||geojson_map.json|"},{"metadata":{},"cell_type":"markdown","source":"|    |    |\n|----|----|\n|train | サイトとフロアごとに整理されたトレーニングパスファイル。各パスファイルには、単一フロアの単一パスのデータが含まれています|\n|test | サイトとフロアごとに整理されたテストパスファイル。各パスファイルには、単一フロアの単一パスのデータが含まれていますが、ウェイポイント（x、y）データは含まれていません。このコンテストのタスクは、特定のサイトパスファイルについて、sample_submission.csvファイルで指定されたタイムスタンプでフロアとウェイポイントの場所を予測することです。|\n|metadata | サイトおよびフロアごとに編成されたフロアメタデータフォルダ。各フロアには次のものが含まれます。|\n||floor_image.png|\n||floor_info.json|\n||geojson_map.json|"},{"metadata":{},"cell_type":"markdown","source":"## train"},{"metadata":{"trusted":true},"cell_type":"code","source":"with open(\"../input/indoor-location-navigation/train/5a0546857ecc773753327266/B1/5e15730aa280850006f3d005.txt\") as f:\n    s = f.read()\n    #print(type(s))\n    #print(s)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## metadata"},{"metadata":{},"cell_type":"markdown","source":"### floot_image.png"},{"metadata":{"trusted":true},"cell_type":"code","source":"fig = plt.figure(figsize=(20,24))\nimg = cv2.imread(\"../input/indoor-location-navigation/metadata/5a0546857ecc773753327266/B1/floor_image.png\")\nplt.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## floor_info.json"},{"metadata":{"trusted":true},"cell_type":"code","source":"json_open = open('../input/indoor-location-navigation/metadata/5a0546857ecc773753327266/B1/floor_info.json', 'r')\njson_load = json.load(json_open)\nprint(json_load)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## geojson_map.json"},{"metadata":{"trusted":true},"cell_type":"code","source":"json_open = open('../input/indoor-location-navigation/metadata/5a0546857ecc773753327266/B1/geojson_map.json', 'r')\njson_load = json.load(json_open)\nprint(json_load)","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"## sample_submission.csv\n\na sample submission file in the correct format; each has a unique id which contains a site id, a path id, and the timestamp within the trace for which to make a prediction; see the Evaluation page for the required integer mapping of floor names\n\n> 正しい形式のサンプル提出ファイル。それぞれに、サイトID、パスID、および予測を行うトレース内のタイムスタンプを含む一意のIDがあります。フロア名に必要な整数マッピングについては、評価ページを参照してください。\n"},{"metadata":{"trusted":true},"cell_type":"code","source":"submission_sample = pd.read_csv(\"../input/indoor-location-navigation/sample_submission.csv\")\nsubmission_sample","execution_count":null,"outputs":[]}],"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat":4,"nbformat_minor":4}