@@ -1742,13 +1742,12 @@ def required_envs(self, conditions=None) -> bool:
1742
1742
]
1743
1743
)
1744
1744
1745
- def test_fbnet (self ):
1745
+ def test_dino_v2 (self ):
1746
1746
if not self .required_envs ([self .image_dataset ]):
1747
1747
self .skipTest ("missing required envs" )
1748
-
1749
1748
cmds = [
1750
1749
"python" ,
1751
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/fbnet .py" ,
1750
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/dino_v2 .py" ,
1752
1751
"--dataset" ,
1753
1752
self .image_dataset ,
1754
1753
"--artifact" ,
@@ -1775,18 +1774,16 @@ def test_fbnet(self):
1775
1774
if "Error" in msg :
1776
1775
self .fail (msg ["Error" ])
1777
1776
else :
1778
- self .assertGreaterEqual (msg ["top_1" ], 60 )
1779
- self .assertGreaterEqual (msg ["top_5" ], 90 )
1777
+ self .assertGreaterEqual (msg ["top_1" ], 70 )
1778
+ self .assertGreaterEqual (msg ["top_5" ], 85 )
1780
1779
1781
- def test_gMLP (self ):
1782
- if not self .required_envs ([ self . image_dataset ] ):
1780
+ def test_esrgan (self ):
1781
+ if not self .required_envs ():
1783
1782
self .skipTest ("missing required envs" )
1784
1783
1785
1784
cmds = [
1786
1785
"python" ,
1787
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/gMLP_image_classification.py" ,
1788
- "--dataset" ,
1789
- self .image_dataset ,
1786
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/esrgan.py" ,
1790
1787
"--artifact" ,
1791
1788
self .artifact_dir ,
1792
1789
"--build_folder" ,
@@ -1795,6 +1792,9 @@ def test_gMLP(self):
1795
1792
self .device ,
1796
1793
"--model" ,
1797
1794
self .model ,
1795
+ "--default_dataset" ,
1796
+ "--oss_repo" ,
1797
+ self .oss_repo ,
1798
1798
"--ip" ,
1799
1799
self .ip ,
1800
1800
"--port" ,
@@ -1811,17 +1811,17 @@ def test_gMLP(self):
1811
1811
if "Error" in msg :
1812
1812
self .fail (msg ["Error" ])
1813
1813
else :
1814
- self .assertGreaterEqual (msg ["top_1 " ], 60 )
1815
- self .assertGreaterEqual (msg ["top_5 " ], 90 )
1814
+ self .assertGreaterEqual (msg ["PSNR " ], 24 )
1815
+ self .assertGreaterEqual (msg ["SSIM " ], 0.8 )
1816
1816
1817
- def test_regnet (self ):
1818
- if not self .required_envs ([self .image_dataset ]):
1817
+ def test_fastvit (self ):
1818
+ if not self .required_envs (
1819
+ [self .image_dataset , self .pretrained_weight , self .oss_repo ]
1820
+ ):
1819
1821
self .skipTest ("missing required envs" )
1820
-
1821
- weights = ["regnet_y_400mf" , "regnet_x_400mf" ]
1822
1822
cmds = [
1823
1823
"python" ,
1824
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/regnet .py" ,
1824
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/fastvit .py" ,
1825
1825
"--dataset" ,
1826
1826
self .image_dataset ,
1827
1827
"--artifact" ,
@@ -1832,6 +1832,10 @@ def test_regnet(self):
1832
1832
self .device ,
1833
1833
"--model" ,
1834
1834
self .model ,
1835
+ "--oss_repo" ,
1836
+ self .oss_repo ,
1837
+ "--pretrained_weight" ,
1838
+ self .pretrained_weight ,
1835
1839
"--ip" ,
1836
1840
self .ip ,
1837
1841
"--port" ,
@@ -1840,27 +1844,26 @@ def test_regnet(self):
1840
1844
if self .host :
1841
1845
cmds .extend (["--host" , self .host ])
1842
1846
1843
- for weight in weights :
1844
- p = subprocess .Popen (
1845
- cmds + ["--weights" , weight ], stdout = subprocess .DEVNULL
1846
- )
1847
- with Listener ((self .ip , self .port )) as listener :
1848
- conn = listener .accept ()
1849
- p .communicate ()
1850
- msg = json .loads (conn .recv ())
1851
- if "Error" in msg :
1852
- self .fail (msg ["Error" ])
1853
- else :
1854
- self .assertGreaterEqual (msg ["top_1" ], 60 )
1855
- self .assertGreaterEqual (msg ["top_5" ], 85 )
1847
+ p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
1848
+ with Listener ((self .ip , self .port )) as listener :
1849
+ conn = listener .accept ()
1850
+ p .communicate ()
1851
+ msg = json .loads (conn .recv ())
1852
+ if "Error" in msg :
1853
+ self .fail (msg ["Error" ])
1854
+ else :
1855
+ self .assertGreaterEqual (msg ["top_1" ], 60 )
1856
+ self .assertGreaterEqual (msg ["top_5" ], 80 )
1856
1857
1857
- def test_ssd300_vgg16 (self ):
1858
- if not self .required_envs ([self .pretrained_weight , self . oss_repo ]):
1858
+ def test_fbnet (self ):
1859
+ if not self .required_envs ([self .image_dataset ]):
1859
1860
self .skipTest ("missing required envs" )
1860
1861
1861
1862
cmds = [
1862
1863
"python" ,
1863
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/ssd300_vgg16.py" ,
1864
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/fbnet.py" ,
1865
+ "--dataset" ,
1866
+ self .image_dataset ,
1864
1867
"--artifact" ,
1865
1868
self .artifact_dir ,
1866
1869
"--build_folder" ,
@@ -1869,10 +1872,6 @@ def test_ssd300_vgg16(self):
1869
1872
self .device ,
1870
1873
"--model" ,
1871
1874
self .model ,
1872
- "--oss_repo" ,
1873
- self .oss_repo ,
1874
- "--pretrained_weight" ,
1875
- self .pretrained_weight ,
1876
1875
"--ip" ,
1877
1876
self .ip ,
1878
1877
"--port" ,
@@ -1889,14 +1888,16 @@ def test_ssd300_vgg16(self):
1889
1888
if "Error" in msg :
1890
1889
self .fail (msg ["Error" ])
1891
1890
else :
1892
- self .assertGreaterEqual (msg ["mAP" ], 0.70 )
1891
+ self .assertGreaterEqual (msg ["top_1" ], 60 )
1892
+ self .assertGreaterEqual (msg ["top_5" ], 90 )
1893
1893
1894
- def test_dino_v2 (self ):
1894
+ def test_gMLP (self ):
1895
1895
if not self .required_envs ([self .image_dataset ]):
1896
1896
self .skipTest ("missing required envs" )
1897
+
1897
1898
cmds = [
1898
1899
"python" ,
1899
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/dino_v2 .py" ,
1900
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/gMLP_image_classification .py" ,
1900
1901
"--dataset" ,
1901
1902
self .image_dataset ,
1902
1903
"--artifact" ,
@@ -1923,16 +1924,19 @@ def test_dino_v2(self):
1923
1924
if "Error" in msg :
1924
1925
self .fail (msg ["Error" ])
1925
1926
else :
1926
- self .assertGreaterEqual (msg ["top_1" ], 70 )
1927
- self .assertGreaterEqual (msg ["top_5" ], 85 )
1927
+ self .assertGreaterEqual (msg ["top_1" ], 60 )
1928
+ self .assertGreaterEqual (msg ["top_5" ], 90 )
1928
1929
1929
- def test_esrgan (self ):
1930
- if not self .required_envs ():
1930
+ def test_regnet (self ):
1931
+ if not self .required_envs ([ self . image_dataset ] ):
1931
1932
self .skipTest ("missing required envs" )
1932
1933
1934
+ weights = ["regnet_y_400mf" , "regnet_x_400mf" ]
1933
1935
cmds = [
1934
1936
"python" ,
1935
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/esrgan.py" ,
1937
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/regnet.py" ,
1938
+ "--dataset" ,
1939
+ self .image_dataset ,
1936
1940
"--artifact" ,
1937
1941
self .artifact_dir ,
1938
1942
"--build_folder" ,
@@ -1941,9 +1945,6 @@ def test_esrgan(self):
1941
1945
self .device ,
1942
1946
"--model" ,
1943
1947
self .model ,
1944
- "--default_dataset" ,
1945
- "--oss_repo" ,
1946
- self .oss_repo ,
1947
1948
"--ip" ,
1948
1949
self .ip ,
1949
1950
"--port" ,
@@ -1952,16 +1953,19 @@ def test_esrgan(self):
1952
1953
if self .host :
1953
1954
cmds .extend (["--host" , self .host ])
1954
1955
1955
- p = subprocess .Popen (cmds , stdout = subprocess .DEVNULL )
1956
- with Listener ((self .ip , self .port )) as listener :
1957
- conn = listener .accept ()
1958
- p .communicate ()
1959
- msg = json .loads (conn .recv ())
1960
- if "Error" in msg :
1961
- self .fail (msg ["Error" ])
1962
- else :
1963
- self .assertGreaterEqual (msg ["PSNR" ], 24 )
1964
- self .assertGreaterEqual (msg ["SSIM" ], 0.8 )
1956
+ for weight in weights :
1957
+ p = subprocess .Popen (
1958
+ cmds + ["--weights" , weight ], stdout = subprocess .DEVNULL
1959
+ )
1960
+ with Listener ((self .ip , self .port )) as listener :
1961
+ conn = listener .accept ()
1962
+ p .communicate ()
1963
+ msg = json .loads (conn .recv ())
1964
+ if "Error" in msg :
1965
+ self .fail (msg ["Error" ])
1966
+ else :
1967
+ self .assertGreaterEqual (msg ["top_1" ], 60 )
1968
+ self .assertGreaterEqual (msg ["top_5" ], 85 )
1965
1969
1966
1970
def test_squeezenet (self ):
1967
1971
if not self .required_envs ([self .image_dataset ]):
@@ -1996,19 +2000,16 @@ def test_squeezenet(self):
1996
2000
if "Error" in msg :
1997
2001
self .fail (msg ["Error" ])
1998
2002
else :
1999
- self .assertGreaterEqual (msg ["top_1" ], 50 )
2000
- self .assertGreaterEqual (msg ["top_5" ], 75 )
2003
+ self .assertGreaterEqual (msg ["top_1" ], 45 )
2004
+ self .assertGreaterEqual (msg ["top_5" ], 70 )
2001
2005
2002
- def test_fastvit (self ):
2003
- if not self .required_envs (
2004
- [self .image_dataset , self .pretrained_weight , self .oss_repo ]
2005
- ):
2006
+ def test_ssd300_vgg16 (self ):
2007
+ if not self .required_envs ([self .pretrained_weight , self .oss_repo ]):
2006
2008
self .skipTest ("missing required envs" )
2009
+
2007
2010
cmds = [
2008
2011
"python" ,
2009
- f"{ self .executorch_root } /examples/qualcomm/oss_scripts/fastvit.py" ,
2010
- "--dataset" ,
2011
- self .image_dataset ,
2012
+ f"{ self .executorch_root } /examples/qualcomm/oss_scripts/ssd300_vgg16.py" ,
2012
2013
"--artifact" ,
2013
2014
self .artifact_dir ,
2014
2015
"--build_folder" ,
@@ -2037,8 +2038,7 @@ def test_fastvit(self):
2037
2038
if "Error" in msg :
2038
2039
self .fail (msg ["Error" ])
2039
2040
else :
2040
- self .assertGreaterEqual (msg ["top_1" ], 60 )
2041
- self .assertGreaterEqual (msg ["top_5" ], 80 )
2041
+ self .assertGreaterEqual (msg ["mAP" ], 0.70 )
2042
2042
2043
2043
2044
2044
class TestExampleQaihubScript (TestQNN ):
0 commit comments