bpiyush commited on
Commit
f252ce9
Β·
verified Β·
1 Parent(s): 1a9d269

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +85 -0
README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🚰 The Sound of Water: Inferring Physical Properties from Pouring Liquids
2
+
3
+ In this folder, we provide the following trained model checkpoints:
4
+
5
+ <p align="center">
6
+ <img src="./assets/pitch_on_spectrogram-compressed.gif" alt="Teaser" width="100%">
7
+ </p>
8
+
9
+ *Key insight*: As water is poured, the fundamental frequency that we hear changes predictably over time as a function of physical properties (e.g., container dimensions).
10
+
11
+ **TL;DR**: We present a method to infer physical properties of liquids from *just* the sound of pouring. We show in theory how *pitch* can be used to derive various physical properties such as container height, flow rate, etc. Then, we train a pitch detection network (`wav2vec2`) using simulated and real data. The resulting model can predict the physical properties of pouring liquids with high accuracy. The latent representations learned also encode information about liquid mass and container shape.
12
+
13
+
14
+ ## Models
15
+
16
+ We provide audio models trained to detect pitch in the sound of pouring water.
17
+ We train these models in two stages:
18
+
19
+ 1. **Pre-training on synthetic data**: We simulate sounds of pouring water using [DDSP](https://arxiv.org/abs/2001.04643) using only 80 samples. This is used to generate lots of simulated sounds of pouring water. Then, we train `wav2vec2` on this data.
20
+ 2. **Fine-tuning on real data**: We fine-tune the model on real data. Since real data does not come with ground truth, we use visual co-supervision from the video stream to fine-tune the audio model.
21
+
22
+ Here, we provide checkpoints for both the stages.
23
+
24
+ <table style="font-size: 12px;" class="center">
25
+ <tr>
26
+ <th><b> File name </b></th>
27
+ <th><b> Description </b></th>
28
+ <th><b> Size </b></th>
29
+ </tr>
30
+ <tr>
31
+ <td>dsr9mf13_ep100_step12423_synthetic_pretrained.pth</td>
32
+ <td>Pre-trained on synthetic data</td>
33
+ <td>361M</td>
34
+ </tr>
35
+ <tr>
36
+ <td>dsr9mf13_ep100_step12423_real_finetuned_with_cosupervision.pth</td>
37
+ <td>Trained with visual co-supervision</td>
38
+ <td>361M</td>
39
+ </tr>
40
+ </table>
41
+
42
+
43
+ Use this snippet to download the models:
44
+
45
+ ```python
46
+ from huggingface_hub import snapshot_download
47
+
48
+ snapshot_download(
49
+ repo_id="bpiyush/sound-of-water-models",
50
+ local_dir="/path/to/download/",
51
+ )
52
+ ```
53
+
54
+ <!-- Add a citation -->
55
+ ## πŸ“œ Citation
56
+
57
+ If you find this repository useful, please consider giving a star ⭐ and citation
58
+
59
+ ```bibtex
60
+ @article{sound_of_water_bagad,
61
+ title={The Sound of Water: Inferring Physical Properties from Pouring Liquids},
62
+ author={Bagad, Piyush and Tapaswi, Makarand and Snoek, Cees G. M. and Zisserman, Andrew},
63
+ journal={arXiv},
64
+ year={2024}
65
+ }
66
+ ```
67
+
68
+ <!-- Add acknowledgements, license, etc. here. -->
69
+ ## πŸ™ Acknowledgements
70
+
71
+ * We thank Ashish Thandavan for support with infrastructure and Sindhu
72
+ Hegde, Ragav Sachdeva, Jaesung Huh, Vladimir Iashin, Prajwal KR, and Aditya Singh for useful
73
+ discussions.
74
+ * This research is funded by EPSRC Programme Grant VisualAI EP/T028572/1, and a Royal Society Research Professorship RP / R1 / 191132.
75
+
76
+ We also want to highlight closely related work that could be of interest:
77
+
78
+ * [Analyzing Liquid Pouring Sequences via Audio-Visual Neural Networks](https://gamma.cs.unc.edu/PSNN/). IROS (2019).
79
+ * [Human sensitivity to acoustic information from vessel filling](https://psycnet.apa.org/record/2000-13210-019). Journal of Experimental Psychology (2020).
80
+ * [See the Glass Half Full: Reasoning About Liquid Containers, Their Volume and Content](https://arxiv.org/abs/1701.02718). ICCV (2017).
81
+ * [CREPE: A Convolutional Representation for Pitch Estimation](https://arxiv.org/abs/1802.06182). ICASSP (2018).
82
+
83
+ ## πŸ™…πŸ» Potential Biases
84
+
85
+ Our model is based on `wav2vec2` which is trained on a large-scale speech recognition data. While this data is not as large as usual datasets in AI, it may still have undesirable biases that are present in the training data.