Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPL 3.0 license comments #5710

Closed
1 of 2 tasks
JJrodny opened this issue Nov 18, 2021 · 13 comments
Closed
1 of 2 tasks

GPL 3.0 license comments #5710

JJrodny opened this issue Nov 18, 2021 · 13 comments
Labels
enhancement New feature or request Stale

Comments

@JJrodny
Copy link

JJrodny commented Nov 18, 2021

Search before asking

  • I have searched the YOLOv5 issues and found no similar feature requests.

Description

First of all, let me say that I was wowed multiple times when training models using this repo. Each time the repo already does the thing that either I need and have implemented myself in other code (e.g. printing out first few training images to confirm my augmentations and data are good), or something that I didn't realize I needed but is super helpful (e.g. printing all of the labels analysis, printing a well thought-out confusion matrix, etc), it has wowed me multiple times, well done!

This issue is in relation to using models trained with this code commercially.

I agree with the GPL 3.0 license for the training portion of this repo, that any improvements on training models should be shared with all, and GPL 3.0 ensures that: anyone who modifies the code must also keep the open access GPL 3.0 license, so everyone can benefit from training even better models.

The problem I'm having is that I'm working on a commercial product which I'd like to include a Yolov5 trained model in it (because of the nice training tools Yolov5 has to make it easier to train models, and because I can add my own augmentations on the fly via albumentations which is written in pytorch). I don't specifically want to modify the training code, I would just like to train a model using the Ultralytics code that's GPL3.0 licensed, and then use that model in my commercial product.

Now, because of the GPL 3.0 license, I can't include any of the Ultralytics code into my product, (otherwise I'd have to publicly publish all of the code for my commercial product, because whatever GPL 3.0 code touches also becomes GPL 3.0).

AFAIK I can however use the model trained by GPL 3.0 code, just like I can write a document in a GPL 3.0 word editor and the document isn't also GPL 3.0 licensed.

And I can inference that model using torch and torchvision libraries, by loading the model file as JIT and inferencing the model with an input image.

My problem now, is that that output is just a tensor - the .pt model is the backbone of the model, and I need to implement the head to convert that tensor into bounding boxes; that tensor is the last tensor in the model architecture before we use the anchors to calculate the bounding boxes.

Now I can't use Yolov5 Ultralytics' inference code that converts the tensor into bounding boxes in my project, becuase it's GPL 3.0 license requires me to make public all of the code that code touches (and thus my competitors will now just copy my code that touches the Ultralytics code)

This means in order for Yolov5 Ultralytics trained models to be used commercially, every commercial entity needs to write their own code to convert the tensor output into bounding boxes.

My request is for the Yolov5 Ultralytics repo to strike that balance between openness and usefulness. In order to keep this training code open and available for all to use, but also to allow commercial entities to use models trained by this code, I'd like to request that the inference code be put in a separate codebase (or a copy of it or something?) with a less stringent copyleft license that allows commercial entities to use that code in their codebases without forcing them to make their codebases public.

This would help Yolov5 Ultralytics to be used as widely as the original DarkNet Yolo repos, while still sharing any improvements in training better and better yolov5 models with everyone.

I did some searching on this and found this #5621 and this #4716 issue, but they don't directly get at what I'm trying to describe.

Thanks for your consideration!

Use case

While technically commercial entities can use the Ultralytics codebase, realistically no commercial entity will want to make their entire codebase public because in order to inference an Ultralytics Yolov5 model, we currently need to either use the Ultralytics code (which forces the company to reveal their own code to competitors), or write their own inference code.

I am currently working on writing my own inference code so that our company can still use the great features this repo allows, but I doubt many other companies have the background and knowledge to do this themselves. Making only the inference code available under a less restrictive license will allow other companies and entities to make use of the Ultralytics codebase and fuel a larger adoption of the code and increase viewership - this is a great repo and more people need to see that!

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@JJrodny JJrodny added the enhancement New feature or request label Nov 18, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 18, 2021

👋 Hello @JJrodny, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

Requirements

Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher glenn-jocher changed the title Yolov5 models currently cannot be used commercially GPL 3.0 license comments Nov 19, 2021
@glenn-jocher
Copy link
Member

glenn-jocher commented Nov 19, 2021

@JJrodny I've modified your incorrect issue title so as not to confuse users. GPL 3.0 clearly allows for commercial use. It's the very first usage example shown in
https://github.com/ultralytics/yolov5/blob/master/LICENSE

Screenshot 2021-11-19 at 14 07 12

@JJrodny
Copy link
Author

JJrodny commented Nov 23, 2021

Hey Glenn, thanks for replying!

I've seen that before, that the ribbon for GPL 3.0 on github says it's permitted to be used commercially, but the problem is it's so restrictive as to never practically be used commercially. Anyone who even links to this code (calls it like a library) must also make their own code open source. That's the problem GPLv3.0 has - companies have to make their code open source to use GPLv3.0 code, which makes it off-limits to many companies.

Here's a quick link with more info on the GPLv3.0 license:
https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)
And under Disclose Source:

All code linked with GPL 3.0 source code must be disclosed under a GPL 3.0 compatible license.

But because of this problem, a similar version of GPLv3.0 was designed to give more people reason to use the code: LGPLv3.0
https://tldrlegal.com/license/gnu-lesser-general-public-license-v3-(lgpl-3)
And under Disclose Source:

If you distribute this library in an executable, you must make the source available for 3 years.

The difference here is that we can now call functions from the code, use the code as a library without having to make the rest of the company's IP-laden codebase open source.

GPLv3.0 says if you even call this code your codebase must also become open source, whereas LGPLv3.0 says that if you call this code (without modifying the code, e.g. just treat the open source code as a library), then you don't have to make the rest of your company codebase open source as well.

This was the problem others have brought up, e.g. Kaggle doesn't accept GPLv3.0 for competitions, #442, #317, and others have pointed out GPLv3.0 allows only commercial Software as a Service (SaaS) uses (force customers to be connected to the internet and pay per image inferenced (unusable without internet access)), but not distribution of the software (allow customers to install a model on an internet-isolated machine once and allow to be run until a new model is needed) #648

I am not a lawyer, but as far as I understand it, what this means for a company, is that:

  • If it's a more permissive license like MIT or Apache, we'll be able to send a customer a packaged solution to e.g. detect visual defects in their manufacturing line, locate whales and other boats on boats out at sea, etc that includes the YOLOv5 codebase.

  • If it's under the LGPLv3.0 license we can send a customer a solution that requires them to download the YOLOv5 codebase as a library, and then our code calls functions in the library, and can still be used in those use cases.

  • If it's under the GPLv3.0 license, we can't send the customer a solution because we'll need to make our IP-laden codebase open source because some of it calls YOLOv5 code, so we'll have to use a different codebase (e.g. Alexey's v4 Scaled Darknet, or Detectron2, etc.). AFAIK only SaaS companies could use it, and then only for uses connected to the internet, (manufacturers rarely connect their PCs to the internet, and internet out at sea requires additional equipment that is not always reliable and can be costly in some instances)

Don't change the license without talking to lawyers/HR or other people knowledgeable about it, but I would suggest Ultralytics' YOLOv5 license be changed to a more permissive version like LGPLv3.0, so that non-SaaS companies can also use YOLOv5.

Thanks for your consideration!
-Jeff

@github-actions
Copy link
Contributor

github-actions bot commented Dec 24, 2021

👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.

Access additional YOLOv5 🚀 resources:

Access additional Ultralytics ⚡ resources:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐!

@rbavery
Copy link
Contributor

rbavery commented Jun 7, 2022

Just curious if there's a response to this? can the inference code be moved away from GPL?

@monkeycc
Copy link

I am calling yolov5 as a plug-in

GPL is very unfriendly and cannot be used for closed source commercial use

LGPL is more appropriate


Main program call yolov5

Yolov5 as a separate folder

Yolov5 open source

Main program is not open source

Can this avoid legal problems

@2015xli
Copy link

2015xli commented Sep 11, 2022

Main program call yolov5
Yolov5 as a separate folder
Yolov5 open source
Main program is not open source
Can this avoid legal problems

I don't think your solution "avoids legal problems".
"Separate folder" means nothing in sense of "legal problems".

@kazimpal87
Copy link

I know the original question was to do with using the yolov5 inference code, but what about this situation?

  • Train a model with yolov5
  • Export to onnx/tensorrt/something else
  • Run inference using that framework
  • Process the output tensor using custom code

Here the program code never touches the yolov5 code, and outputs of GPL code (ie. the model file) are not automatically GPL, so (as far as i understand) the program code doesnt need to be GPL. Is that right?

@hamishc
Copy link

hamishc commented Jan 26, 2023

Unfortunately this seems to be the way that @glenn-jocher replies to complex issues - a short patronising response that ignores the crux of the question, and then goes silent on any followups. Given that their recent YOLOv8 release offers enterprise licenses, I read the above comment that "GPL 3.0 clearly allows for commercial use" as wilfully misleading in order to not steer people away from using YOLOv5. I wouldn't expect any more info in this thread, and I would advise anyone concerned about the implications of this license to stay away from ultralytics' work.

@catarinamf
Copy link

Hi,

When searching for the constraints of using GPL3.0 license, found this issue.

It's clear that we can't use GPL3.0 license for commercial use, without having to make our developed code opensource.

What about the training models?
@kazimpal87 do you already have an answer for your question? @adrianboguszewski ? @glenn-jocher ? Can you enlighten?
#5710 (comment)

I know the original question was to do with using the yolov5 inference code, but what about this situation?

  • Train a model with yolov5

  • Export to onnx/tensorrt/something else

  • Run inference using that framework

  • Process the output tensor using custom code

Here the program code never touches the yolov5 code, and outputs of GPL code (ie. the model file) are not automatically GPL, >so (as far as i understand) the program code doesnt need to be GPL. Is that right?

Thanks in advance!

@glenn-jocher
Copy link
Member

@catarinamf hi,

Regarding your question about using the YOLOv5 models trained under the GPL3.0 license, I'm afraid I don't have the official answer. It would be best to reach out to the Ultralytics team directly or consult with legal experts to get a definitive answer on the licensing implications of using trained models in your specific scenario.

Keep in mind that while the trained model outputs themselves may not inherit the GPL license, the underlying GPL3.0 code used for training (YOLOv5 in this case) could have potential implications for the usage and distribution of your code that interacts with these models.

To ensure compliance and avoid any legal issues, it's recommended to seek professional advice or consult the Ultralytics team for clarification on licensing matters.

Best regards,

@catarinamf
Copy link

catarinamf commented Jul 31, 2023 via email

@glenn-jocher
Copy link
Member

@catarinamf thanks for your interest in YOLOv5 and your kind words!

Regarding your question about using trained models under the GPL3.0 license, I'm unable to provide an official answer. I would suggest reaching out to the Ultralytics team directly or consulting with legal experts to get a definitive answer on the licensing implications of using trained models in your specific scenario.

It's important to consider that while the trained model outputs themselves may not inherit the GPL license, the underlying GPL3.0 code used for training (YOLOv5) could have potential implications for the usage and distribution of your code that interacts with these models.

To ensure compliance and avoid any potential legal issues, seeking professional advice or consulting the Ultralytics team for clarification on licensing matters is recommended.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

8 participants