mlx icon indicating copy to clipboard operation
mlx copied to clipboard

Using Yolov8 and Anomalib with MLX

Open AhmedHamadto opened this issue 1 year ago • 10 comments

I am currently working on computer vision and anomaly detection projects and was wondering how would I use yolov8 and anomalib with the MLX framework?

The plan is to use Mac Minis as edge computers to handle all of the image processing.

I'd like to add I am new to using github issues and hope this is the right place and right way to ask my question.

Any and all guidance is appreciated.

Thank you in advance.

AhmedHamadto avatar Jan 09 '24 06:01 AhmedHamadto

I guess you cannot use both at the moment with MLX. You would need to re-implement / port the models you need over to MLX.

menzHSE avatar Jan 09 '24 15:01 menzHSE

@AhmedHamadto Maybe you can wait until those pooling layers are released before implementing your version of yolov8 on MLX. :>

NeptuneIsTheBest avatar Jan 09 '24 19:01 NeptuneIsTheBest

@NeptuneIsTheBest so basically once they release the layers you're suggesting I rebuild yolov8 from the ground up on MLX? Sounds interesting.

AhmedHamadto avatar Jan 10 '24 01:01 AhmedHamadto

Hi, I'm trying to implement yolov5 with MLX.

So, I already made some blocks as : ConvBlock, C3f, Bottleneck and SPPF (their names in ultralytics repo). But yes, MaxPooling is not implemented and I'm facing the same issue so I will code it using Python (I don't have C++ knwoledge to implement it).

Let me know If you want to collaborate on this ;)

bertinma avatar Jan 11 '24 15:01 bertinma

For MaxPooling, also have a look at https://github.com/robertmccraith/mimm/blob/main/mimm/layers/max_pool.py

menzHSE avatar Jan 11 '24 15:01 menzHSE

@bertinma I would be quite interested in that, I have a few colleagues whom have also expressed interest, I think a collaboration on this would be genuinely fruitful.

I have created a discord server for this project, this is the invite link: https://discord.gg/XBUP5kVC

AhmedHamadto avatar Jan 12 '24 01:01 AhmedHamadto

Professor @menzHSE , if you're interested in joining us it would be an honour and pleasure to have you onboard.

AhmedHamadto avatar Jan 12 '24 02:01 AhmedHamadto

I have to pass on that, sorry. But I will follow your progress and am happy to try out and test your implementation.

menzHSE avatar Jan 12 '24 06:01 menzHSE

@NeptuneIsTheBest so basically once they release the layers you're suggesting I rebuild yolov8 from the ground up on MLX? Sounds interesting.

@AhmedHamadto Hello, because I think this can reduce duplication of work. You don't need to make your code change frequently and just focus on high-level implementation. If I can help you, I hope to join you (because I also want to implement the MLX version of yolov7). It would be a great honor for me to be a part of your project. :>

NeptuneIsTheBest avatar Jan 12 '24 06:01 NeptuneIsTheBest

@NeptuneIsTheBest Welcome aboard! The more the merrier, please do feel free to join the discord channel via the above invite link! Happy to have you with us 😄

AhmedHamadto avatar Jan 12 '24 08:01 AhmedHamadto