egrace479 commited on
Commit
1658ae3
·
verified ·
1 Parent(s): b2b3bbd

Update ohio small animals CSVs with filename column

Browse files

Need unique ID without spaces in it for download with cautious-robot

README.md CHANGED
@@ -268,6 +268,8 @@ Each of the `<dataset_name>_<type>` CSVs has the following columns.
268
  - `num_sp_images`: number of images of that species in the dataset.
269
  For the island CSVs, instead of `num_sp_images` there are `num_fam_images` and `num_cn_images` representing the number of images for the family or common name, respectively.
270
 
 
 
271
 
272
  ### Data Splits
273
  [More Information Needed]
 
268
  - `num_sp_images`: number of images of that species in the dataset.
269
  For the island CSVs, instead of `num_sp_images` there are `num_fam_images` and `num_cn_images` representing the number of images for the family or common name, respectively.
270
 
271
+ Additionally, the `ohio-small-animals` CSVs have a `filename` column defined as `OH_sm_animals_<filename in url_aws>`.
272
+
273
 
274
  ### Data Splits
275
  [More Information Needed]
data/potential-test-sets/filtered/ohio-small-animals-balanced.csv CHANGED
The diff for this file is too large to render. See raw diff
 
data/potential-test-sets/filtered/ohio-small-animals-upper-bound.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:892bb597ed604cf4461ebf5674dbf1e3c6642c8bbfe520c92ce4ec2e7a28d75a
3
- size 61527832
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7fcb646860e51c38cb7ac7001c274d200a5f8cf243702a86bad23c40c099cbf5
3
+ size 65257241
data/potential-test-sets/filtered/ohio-small-animals-upper-lower-bound.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:13341724b852347d612d633b32cd5d044faecfc2af64a24d1f860367ed78a9b3
3
- size 61507847
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3bb453e9977f393572888a4dcb87270a160d280ade03079c991d540201a9beee
3
+ size 65236110
notebooks/lilabc_test-ohio-small-animal.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 1,
6
  "metadata": {},
7
  "outputs": [],
8
  "source": [
@@ -1583,7 +1583,7 @@
1583
  },
1584
  {
1585
  "cell_type": "code",
1586
- "execution_count": 42,
1587
  "metadata": {},
1588
  "outputs": [
1589
  {
@@ -1592,7 +1592,7 @@
1592
  "468"
1593
  ]
1594
  },
1595
- "execution_count": 42,
1596
  "metadata": {},
1597
  "output_type": "execute_result"
1598
  }
@@ -1618,7 +1618,7 @@
1618
  },
1619
  {
1620
  "cell_type": "code",
1621
- "execution_count": 43,
1622
  "metadata": {},
1623
  "outputs": [],
1624
  "source": [
@@ -1627,6 +1627,118 @@
1627
  "df_balanced.to_csv(\"../data/potential-test-sets/filtered/ohio-small-animals-balanced.csv\", index = False)"
1628
  ]
1629
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1630
  {
1631
  "cell_type": "code",
1632
  "execution_count": null,
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 2,
6
  "metadata": {},
7
  "outputs": [],
8
  "source": [
 
1583
  },
1584
  {
1585
  "cell_type": "code",
1586
+ "execution_count": 10,
1587
  "metadata": {},
1588
  "outputs": [
1589
  {
 
1592
  "468"
1593
  ]
1594
  },
1595
+ "execution_count": 10,
1596
  "metadata": {},
1597
  "output_type": "execute_result"
1598
  }
 
1618
  },
1619
  {
1620
  "cell_type": "code",
1621
+ "execution_count": 11,
1622
  "metadata": {},
1623
  "outputs": [],
1624
  "source": [
 
1627
  "df_balanced.to_csv(\"../data/potential-test-sets/filtered/ohio-small-animals-balanced.csv\", index = False)"
1628
  ]
1629
  },
1630
+ {
1631
+ "cell_type": "markdown",
1632
+ "metadata": {},
1633
+ "source": [
1634
+ "### Need to add unique filenames"
1635
+ ]
1636
+ },
1637
+ {
1638
+ "cell_type": "code",
1639
+ "execution_count": 3,
1640
+ "metadata": {},
1641
+ "outputs": [],
1642
+ "source": [
1643
+ "df_reduced = pd.read_csv(\"../data/potential-test-sets/filtered/ohio-small-animals-upper-bound.csv\", low_memory=False)"
1644
+ ]
1645
+ },
1646
+ {
1647
+ "cell_type": "code",
1648
+ "execution_count": 4,
1649
+ "metadata": {},
1650
+ "outputs": [
1651
+ {
1652
+ "data": {
1653
+ "text/plain": [
1654
+ "'http://us-west-2.opendata.source.coop.s3.amazonaws.com/agentmorris/lila-wildlife/osu-small-animals/Images/Sorted_by_species/Amphibia/American Bullfrog/BIWA3N_2020-07-12_06-50-28.JPG'"
1655
+ ]
1656
+ },
1657
+ "execution_count": 4,
1658
+ "metadata": {},
1659
+ "output_type": "execute_result"
1660
+ }
1661
+ ],
1662
+ "source": [
1663
+ "df_reduced.url_aws.values[0]"
1664
+ ]
1665
+ },
1666
+ {
1667
+ "cell_type": "code",
1668
+ "execution_count": 5,
1669
+ "metadata": {},
1670
+ "outputs": [
1671
+ {
1672
+ "data": {
1673
+ "text/plain": [
1674
+ "'https://lilawildlife.blob.core.windows.net/lila-wildlife/osu-small-animals/Images/Sorted_by_species/Amphibia/American Bullfrog/BIWA3N_2020-07-12_06-50-28.JPG'"
1675
+ ]
1676
+ },
1677
+ "execution_count": 5,
1678
+ "metadata": {},
1679
+ "output_type": "execute_result"
1680
+ }
1681
+ ],
1682
+ "source": [
1683
+ "df_reduced.url_azure.values[0]"
1684
+ ]
1685
+ },
1686
+ {
1687
+ "cell_type": "code",
1688
+ "execution_count": 6,
1689
+ "metadata": {},
1690
+ "outputs": [
1691
+ {
1692
+ "data": {
1693
+ "text/plain": [
1694
+ "'BIWA3N_2020-07-12_06-50-28.JPG'"
1695
+ ]
1696
+ },
1697
+ "execution_count": 6,
1698
+ "metadata": {},
1699
+ "output_type": "execute_result"
1700
+ }
1701
+ ],
1702
+ "source": [
1703
+ "df_reduced.url_aws.values[0].split(\"/\")[-1]"
1704
+ ]
1705
+ },
1706
+ {
1707
+ "cell_type": "code",
1708
+ "execution_count": 7,
1709
+ "metadata": {},
1710
+ "outputs": [],
1711
+ "source": [
1712
+ "for img_id in list(df_reduced[\"image_id\"]):\n",
1713
+ " url = df_reduced.loc[df_reduced[\"image_id\"] == img_id, \"url_aws\"].values[0]\n",
1714
+ " df_reduced.loc[df_reduced[\"image_id\"] == img_id, \"filename\"] = \"OH_sm_animals_\" + url.split(\"/\")[-1]"
1715
+ ]
1716
+ },
1717
+ {
1718
+ "cell_type": "markdown",
1719
+ "metadata": {},
1720
+ "source": [
1721
+ "Resave upper bound and upper-lower"
1722
+ ]
1723
+ },
1724
+ {
1725
+ "cell_type": "code",
1726
+ "execution_count": 9,
1727
+ "metadata": {},
1728
+ "outputs": [],
1729
+ "source": [
1730
+ "df_reduced.to_csv(\"../data/potential-test-sets/filtered/ohio-small-animals-upper-bound.csv\", index = False)\n",
1731
+ "df_reduced_upper_lower = df_reduced.loc[df_reduced[\"num_sp_images\"] >= 10].copy()\n",
1732
+ "df_reduced_upper_lower.to_csv(\"../data/potential-test-sets/filtered/ohio-small-animals-upper-lower-bound.csv\", index = False)"
1733
+ ]
1734
+ },
1735
+ {
1736
+ "cell_type": "markdown",
1737
+ "metadata": {},
1738
+ "source": [
1739
+ "Rerun the balanced set part as well."
1740
+ ]
1741
+ },
1742
  {
1743
  "cell_type": "code",
1744
  "execution_count": null,