You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[15], line 2
1 # Generates a directory with masks
----> 2 segmenter = GlassesSegmenter(kind="lenses", size="l")
3 segmenter.process_dir(
4 input_path=r"C:/python_project/glasses-detector/data", # output dir defaults to path/to/dir_preds
5 output_path="./output",
(...)
10 output_size=None, # set to None to keep the same size as image
11 )
File :7, in init(self, kind, size, weights, device)
File c:\Users\EugeneLin\AppData\Local\miniconda3\envs\GLASSES-DETECTOR\Lib\site-packages\glasses_detector\components\base_model.py:189, in BaseGlassesModel.post_init(self)
185 self.device = torch.device("cpu")
187 if self.weights:
188 # Load weights if True or path is specified
--> 189 self.load_weights(path_or_url=self.weights)
191 # Cast to device
192 self.model.to(self.device)
File c:\Users\EugeneLin\AppData\Local\miniconda3\envs\GLASSES-DETECTOR\Lib\site-packages\glasses_detector\components\base_model.py:547, in BaseGlassesModel.load_weights(self, path_or_url)
544 return
546 if self.size.lower() in self.ALLOWED_SIZE_ALIASES["large"]:
--> 547 raise NotImplementedError("Large models are not supported yet")
549 # Construct weights URL from base URL and model info
550 weights_name = f"{self.task}{self.kind}{name}.pth"
NotImplementedError: Large models are not supported yet
`
Dear glasses-detector developer, thanks for this amazing tool, helping me a lot! While I'm using segmenter, I input size argument with "large" or "l". In the API document page, it does support the large argument, but when I input the large argument, it returns upper error, how can I fix it?
Thanks for reply, Eugene Lin.
The text was updated successfully, but these errors were encountered:
Hi @godisme1220, yeah, unfortunately, weights for large models are unavailable but it is only indicated in Performance Section. Thanks for pointing this out, I should make documentation clearer. It is only possible to instantiate a large model without pretrained weights:
If you specifically need lenses segmentation, then you could check #13 where I provided large model weights that may work slightly better.
In general, I tried training large models for all tasks but their performance did not outperform medium models, thus I didn't include them. I think these could be the reasons:
Large models are typically used for more complex tasks, here we are dealing with binary segmentation/classification
Large models would perform better if they were trained on much larger datasets (I couldn't find more :/)
Large models could perform better if the model architecture, as well as hyperparameters, were specifically tuned for each task
`---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
Cell In[15], line 2
1 # Generates a directory with masks
----> 2 segmenter = GlassesSegmenter(kind="lenses", size="l")
3 segmenter.process_dir(
4 input_path=r"C:/python_project/glasses-detector/data", # output dir defaults to path/to/dir_preds
5 output_path="./output",
(...)
10 output_size=None, # set to None to keep the same size as image
11 )
File :7, in init(self, kind, size, weights, device)
File c:\Users\EugeneLin\AppData\Local\miniconda3\envs\GLASSES-DETECTOR\Lib\site-packages\glasses_detector\components\base_model.py:189, in BaseGlassesModel.post_init(self)
185 self.device = torch.device("cpu")
187 if self.weights:
188 # Load weights if True or path is specified
--> 189 self.load_weights(path_or_url=self.weights)
191 # Cast to device
192 self.model.to(self.device)
File c:\Users\EugeneLin\AppData\Local\miniconda3\envs\GLASSES-DETECTOR\Lib\site-packages\glasses_detector\components\base_model.py:547, in BaseGlassesModel.load_weights(self, path_or_url)
544 return
546 if self.size.lower() in self.ALLOWED_SIZE_ALIASES["large"]:
--> 547 raise NotImplementedError("Large models are not supported yet")
549 # Construct weights URL from base URL and model info
550 weights_name = f"{self.task}{self.kind}{name}.pth"
NotImplementedError: Large models are not supported yet
`
Dear glasses-detector developer, thanks for this amazing tool, helping me a lot! While I'm using segmenter, I input size argument with "large" or "l". In the API document page, it does support the large argument, but when I input the large argument, it returns upper error, how can I fix it?
Thanks for reply, Eugene Lin.
The text was updated successfully, but these errors were encountered: