{"cells":[{"metadata":{},"cell_type":"markdown","source":"# Load and display 3D models\n\nIn this notebook, we'll see how to load a car from a JSON file and display it in 3D."},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"import json\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\n\nwith open('../input/pku-autonomous-driving/car_models_json/benchi-ML500.json') as json_file:\n    data = json.load(json_file)\n    vertices = np.array(data['vertices'])\n    triangles = np.array(data['faces']) - 1\n    plt.figure(figsize=(20,10))\n    ax = plt.axes(projection='3d')\n    ax.set_title('car_type: '+data['car_type'])\n    ax.set_xlim([-3, 3])\n    ax.set_ylim([-3, 3])\n    ax.set_zlim([0, 3])\n    ax.plot_trisurf(vertices[:,0], vertices[:,2], triangles, -vertices[:,1], shade=True, color='grey')","execution_count":null,"outputs":[]},{"metadata":{},"cell_type":"markdown","source":"# Conclusion\n\nAs you can see it is pretty easy to load a JSON file from this competition and to display the car model in 3D.\n\nHappy kaggling!\n\nyes"},{"metadata":{"trusted":true},"cell_type":"code","source":"","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":1}