import%20marimo%0A%0A__generated_with%20%3D%20%220.16.5%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20os%0A%20%20%20%20import%20pandas%20as%20pd%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20from%20PIL%20import%20Image%0A%20%20%20%20import%20altair%20as%20alt%0A%20%20%20%20return%20Image%2C%20alt%2C%20mo%2C%20os%2C%20pd%0A%0A%0A%40app.cell%0Adef%20_(os)%3A%0A%20%20%20%20files_list%20%3D%20os.listdir('..%2Fidentified_images%2F')%0A%20%20%20%20files_list%0A%20%20%20%20return%20(files_list%2C)%0A%0A%0A%40app.cell%0Adef%20_(Image%2C%20files_list%2C%20pd)%3A%0A%20%20%20%20%23%20Process%20image%20data%0A%20%20%20%20weights%20%3D%20%5B%5D%0A%20%20%20%20images%20%3D%20%5B%5D%0A%20%20%20%20species%20%3D%20%5B%5D%0A%20%20%20%20for%20file%20in%20files_list%3A%0A%20%20%20%20%20%20%20%20parts%20%3D%20file.split('_')%0A%20%20%20%20%20%20%20%20weight_str%20%3D%20parts%5B-1%5D.replace('g.jpg'%2C%20'')%0A%20%20%20%20%20%20%20%20weight%20%3D%20float(weight_str)%0A%20%20%20%20%20%20%20%20specie%20%3D%20parts%5B0%5D%0A%20%20%20%20%20%20%20%20if%20specie%20%3D%3D%20%22cat%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20specie%20%3D%20%22other%22%0A%20%20%20%20%20%20%20%20weights.append(weight)%0A%20%20%20%20%20%20%20%20images.append(Image.open('..%2Fidentified_images%2F'%2Bfile))%0A%20%20%20%20%20%20%20%20species.append(specie)%0A%0A%20%20%20%20weights_df%20%3D%20pd.DataFrame(%7B'Weight'%3A%20weights%2C%20'Image'%3A%20images%2C%20'Species'%3A%20species%7D)%0A%0A%20%20%20%20weights_df%20%3D%20weights_df.sort_values('Weight'%2C%20ascending%3DFalse).reset_index(drop%3DTrue)%0A%0A%20%20%20%20weights_df%0A%20%20%20%20return%20(weights_df%2C)%0A%0A%0A%40app.cell%0Adef%20_(alt%2C%20mo%2C%20weights_df)%3A%0A%20%20%20%20%23%20Create%20the%20histogram%0A%20%20%20%20_chart%20%3D%20(%0A%20%20%20%20%20%20%20%20alt.Chart(weights_df)%0A%20%20%20%20%20%20%20%20.mark_bar()%0A%20%20%20%20%20%20%20%20.encode(%0A%20%20%20%20%20%20%20%20%20%20%20%20x%3Dalt.X('Weight%3AQ'%2C%20bin%3Dalt.Bin(maxbins%3D15)%2C%20title%3D'Weight%20(g)')%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20y%3Dalt.Y('count()%3AQ'%2C%20title%3D'Frequency')%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20tooltip%3D%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20alt.Tooltip('Weight%3AQ'%2C%20format%3D'%2C.2f')%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20alt.Tooltip('count()%3AQ')%0A%20%20%20%20%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20.properties(height%3D400%2C%20width%3D'container')%0A%20%20%20%20)%0A%20%20%20%20mo.vstack(%5B%0A%20%20%20%20%20%20%20%20mo.md(%22%23%23%20Bird%20Weight%20Distribution%22)%2C%0A%20%20%20%20%20%20%20%20_chart%2C%0A%0A%20%20%20%20%5D)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
0953cc4c653b53560339f56920092598c3e01f4210ea49253b7beedab8d1ff9a