├── LICENSE ├── README.md ├── UIFunctions.py ├── config ├── fold.json ├── ip.json └── setting.json ├── custom_grips.py ├── home.ui ├── img ├── IOU.png ├── RTSP.png ├── begin.png ├── box_down.png ├── box_up.png ├── cam.png ├── check_no.png ├── check_yes.png ├── conf.png ├── delay.png ├── file.png ├── home.png ├── logo.png ├── menu.png ├── model.png ├── pause.png ├── resize.png ├── save.png ├── set.png └── stop.png ├── main.py ├── models └── yolov8n.pt ├── resources.qrc ├── test-img.jpg ├── ui ├── CustomMessageBox.py ├── home.py ├── resources_rc.py └── rtsp_dialog.ui └── utils ├── capnums.py ├── rtsp_dialog.py └── rtsp_win.py /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YoloSide ~ A GUI For YoloV8 `V2.0` 2 | --- 3 | ![](img/home.png) 4 | 5 | ## 🛑Warning 6 | - This project has been discontinued for maintenance, and normal operation is not guaranteed. You can continue to refer to the following projects. Thanks to every open source contributor for their contribution. 7 | - 此项目已经停止维护,不保证仍能正常运行。您可以继续参考以下项目: 8 | - [Ultralytics-PySide6](https://github.com/WangQvQ/Ultralytics-PySide6) 9 | - [YOLOSHOW](https://github.com/SwimmingLiu/YOLOSHOW) 10 | - [yolov8客户端-简单修改](https://www.bilibili.com/video/BV1xh4y1F7sv/?spm_id_from=333.999.0.0&vd_source=0940bf29b38efba56ccfc6a3cef8182d) 11 | - [YOLOv8-GUI-PySide6](https://github.com/SuPoTing/YOLOv8-GUI-PySide6) 12 | - Please search for more projects on github yourself, all the best. 13 | 14 | ## How to Run 15 | - `python>=3.8` 16 | - `pip install ultralytics==8.0.48` 17 | - `pip install pyside6==6.4.2` 18 | - `python main.py` 19 | 20 | #### !!The corresponding version of the library must be installed 21 | #### !!Otherwise, the following error will appear:`not enough values to unpack (expected 5, got 4)` 22 | 23 | ## Notice 24 | - `ultralytics` follows the `GPL-3.0`, if you need commercial use, you need to obtain its license. 25 | - If you expect to use your own model, you need to use `ultralytics` to train the yolov8/5 model first, and then put the trained `.pt` file into the `models` folder. 26 | - There are still some bugs in the software, and I will continue to optimize and add some more interesting functions as my time allows. 27 | - If you check the save results, they will be saved in the `./run` path 28 | - The UI design file is `home.ui`, if you modify it, you need to use the `pyside6-uic home.ui > ui/home.py` command to regenerate the `.py` file 29 | - The resource file is `resources.qrc`, if you modify the default icon, you need to use the `pyside6-rcc resoures.qrc > ui/resources_rc.py` command to regenerate the `.py` file 30 | 31 | ## Video 32 | - [BiliBili~YoloSide V2.0](https://www.bilibili.com/video/BV1Cb411f7cw/?spm_id_from=333.999.0.0) 33 | - [Youtube~YoloSide V2.0](https://www.youtube.com/watch?v=auJLVrt7ImQ) 34 | 35 | ## To Do 36 | 37 | - [ ] The input source supports camera and RTSP (if you need this function urgently, you can modify it according to the `chosen_cam`、`chose_rtsp`、`load_rtsp` function in `mian.py`) 38 | - [ ] Graph showing changes in target quantity 39 | - [ ] Target tracking 40 | - [ ] Instance segmentation 41 | - [ ] Monitor system hardware usage 42 | 43 | ## References 44 | - [PyQt5-YOLOv5](https://github.com/Javacr/PyQt5-YOLOv5) 45 | - [ultralytics](https://github.com/ultralytics/ultralytics) 46 | - [pyqt5仿交易软件界面](https://www.bilibili.com/video/BV1tg411Y7KH/?spm_id_from=333.999.0.0&vd_source=0940bf29b38efba56ccfc6a3cef8182d) 47 | -------------------------------------------------------------------------------- /UIFunctions.py: -------------------------------------------------------------------------------- 1 | from main import * 2 | from custom_grips import CustomGrip 3 | from PySide6.QtCore import QPropertyAnimation, QEasingCurve, QEvent, QTimer 4 | from PySide6.QtCore import * 5 | from PySide6.QtGui import * 6 | from PySide6.QtWidgets import * 7 | import time 8 | 9 | GLOBAL_STATE = False # max min flag 10 | GLOBAL_TITLE_BAR = True 11 | 12 | 13 | class UIFuncitons(MainWindow): 14 | # Expand left menu 15 | def toggleMenu(self, enable): 16 | if enable: 17 | standard = 68 18 | maxExtend = 180 19 | width = self.LeftMenuBg.width() 20 | 21 | if width == 68: 22 | widthExtended = maxExtend 23 | else: 24 | widthExtended = standard 25 | 26 | # animation 27 | self.animation = QPropertyAnimation(self.LeftMenuBg, b"minimumWidth") 28 | self.animation.setDuration(500) # ms 29 | self.animation.setStartValue(width) 30 | self.animation.setEndValue(widthExtended) 31 | self.animation.setEasingCurve(QEasingCurve.InOutQuint) 32 | self.animation.start() 33 | 34 | # Expand the settings menu on the right 35 | def settingBox(self, enable): 36 | if enable: 37 | # GET WIDTH 38 | widthRightBox = self.prm_page.width() # right set column width 39 | widthLeftBox = self.LeftMenuBg.width() # left column length 40 | maxExtend = 220 41 | standard = 0 42 | 43 | # SET MAX WIDTH 44 | if widthRightBox == 0: 45 | widthExtended = maxExtend 46 | else: 47 | widthExtended = standard 48 | 49 | # ANIMATION LEFT BOX 50 | self.left_box = QPropertyAnimation(self.LeftMenuBg, b"minimumWidth") 51 | self.left_box.setDuration(500) 52 | self.left_box.setStartValue(widthLeftBox) 53 | self.left_box.setEndValue(68) 54 | self.left_box.setEasingCurve(QEasingCurve.InOutQuart) 55 | 56 | # ANIMATION RIGHT BOX 57 | self.right_box = QPropertyAnimation(self.prm_page, b"minimumWidth") 58 | self.right_box.setDuration(500) 59 | self.right_box.setStartValue(widthRightBox) 60 | self.right_box.setEndValue(widthExtended) 61 | self.right_box.setEasingCurve(QEasingCurve.InOutQuart) 62 | 63 | # GROUP ANIMATION 64 | self.group = QParallelAnimationGroup() 65 | self.group.addAnimation(self.left_box) 66 | self.group.addAnimation(self.right_box) 67 | self.group.start() 68 | 69 | # maximize window 70 | def maximize_restore(self): 71 | global GLOBAL_STATE 72 | status = GLOBAL_STATE 73 | if status == False: 74 | GLOBAL_STATE = True 75 | self.showMaximized() # maximize 76 | # self.Main_QW.setContentsMargins(0, 0, 0, 0) # appMargins = Main_QW 77 | self.max_sf.setToolTip("Restore") 78 | self.frame_size_grip.hide() # Hide the interface size adjustment button 79 | self.left_grip.hide() # Up, down, left, and right adjustments are prohibited 80 | self.right_grip.hide() 81 | self.top_grip.hide() 82 | self.bottom_grip.hide() 83 | else: 84 | GLOBAL_STATE = False 85 | self.showNormal() # minimize 86 | self.resize(self.width()+1, self.height()+1) 87 | # self.Main_QW.setContentsMargins(10, 10, 10, 10) 88 | self.max_sf.setToolTip("Maximize") 89 | self.frame_size_grip.show() 90 | self.left_grip.show() 91 | self.right_grip.show() 92 | self.top_grip.show() 93 | self.bottom_grip.show() 94 | 95 | # window control 96 | def uiDefinitions(self): 97 | # Double-click the title bar to maximize 98 | def dobleClickMaximizeRestore(event): 99 | if event.type() == QEvent.MouseButtonDblClick: 100 | QTimer.singleShot(250, lambda: UIFuncitons.maximize_restore(self)) 101 | self.top.mouseDoubleClickEvent = dobleClickMaximizeRestore 102 | 103 | # MOVE WINDOW / MAXIMIZE / RESTORE 104 | def moveWindow(event): 105 | if GLOBAL_STATE: # IF MAXIMIZED CHANGE TO NORMAL 106 | UIFuncitons.maximize_restore(self) 107 | if event.buttons() == Qt.LeftButton: # MOVE 108 | self.move(self.pos() + event.globalPos() - self.dragPos) 109 | self.dragPos = event.globalPos() 110 | self.top.mouseMoveEvent = moveWindow 111 | # CUSTOM GRIPS 112 | self.left_grip = CustomGrip(self, Qt.LeftEdge, True) 113 | self.right_grip = CustomGrip(self, Qt.RightEdge, True) 114 | self.top_grip = CustomGrip(self, Qt.TopEdge, True) 115 | self.bottom_grip = CustomGrip(self, Qt.BottomEdge, True) 116 | 117 | # MINIMIZE 118 | self.min_sf.clicked.connect(lambda: self.showMinimized()) 119 | # MAXIMIZE/RESTORE 120 | self.max_sf.clicked.connect(lambda: UIFuncitons.maximize_restore(self)) 121 | # CLOSE APPLICATION 122 | self.close_button.clicked.connect(self.close) 123 | 124 | # Control the stretching of the four sides of the window 125 | def resize_grips(self): 126 | self.left_grip.setGeometry(0, 10, 10, self.height()) 127 | self.right_grip.setGeometry(self.width() - 10, 10, 10, self.height()) 128 | self.top_grip.setGeometry(0, 0, self.width(), 10) 129 | self.bottom_grip.setGeometry(0, self.height() - 10, self.width(), 10) 130 | 131 | # Show module to add shadow 132 | def shadow_style(self, widget, Color): 133 | shadow = QGraphicsDropShadowEffect(self) 134 | shadow.setOffset(8, 8) # offset 135 | shadow.setBlurRadius(38) # shadow radius 136 | shadow.setColor(Color) # shadow color 137 | widget.setGraphicsEffect(shadow) -------------------------------------------------------------------------------- /config/fold.json: -------------------------------------------------------------------------------- 1 | { 2 | "open_fold": "D:/Code/yolov8" 3 | } -------------------------------------------------------------------------------- /config/ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "ip": "rtsp://admin:admin888@192.168.1.2:555" 3 | } -------------------------------------------------------------------------------- /config/setting.json: -------------------------------------------------------------------------------- 1 | { 2 | "iou": 0.45, 3 | "conf": 0.25, 4 | "rate": 10, 5 | "save_res": 0, 6 | "save_txt": 0 7 | } -------------------------------------------------------------------------------- /custom_grips.py: -------------------------------------------------------------------------------- 1 | from PySide6.QtCore import * 2 | from PySide6.QtGui import * 3 | from PySide6.QtWidgets import * 4 | 5 | # After the interface hides the window, use this file to achieve borderless stretching of the window 6 | class CustomGrip(QWidget): 7 | def __init__(self, parent, position, disable_color = False): 8 | # SETUP UI 9 | QWidget.__init__(self) 10 | self.parent = parent 11 | self.setParent(parent) 12 | self.wi = Widgets() 13 | 14 | # SHOW TOP GRIP 15 | if position == Qt.TopEdge: 16 | self.wi.top(self) 17 | self.setGeometry(0, 0, self.parent.width(), 10) 18 | self.setMaximumHeight(10) 19 | 20 | # GRIPS 21 | top_left = QSizeGrip(self.wi.top_left) 22 | top_right = QSizeGrip(self.wi.top_right) 23 | 24 | # RESIZE TOP 25 | def resize_top(event): 26 | delta = event.pos() 27 | height = max(self.parent.minimumHeight(), self.parent.height() - delta.y()) 28 | geo = self.parent.geometry() 29 | geo.setTop(geo.bottom() - height) 30 | self.parent.setGeometry(geo) 31 | event.accept() 32 | self.wi.top.mouseMoveEvent = resize_top 33 | 34 | # ENABLE COLOR 35 | if disable_color: 36 | self.wi.top_left.setStyleSheet("background: transparent") 37 | self.wi.top_right.setStyleSheet("background: transparent") 38 | self.wi.top.setStyleSheet("background: transparent") 39 | 40 | # SHOW BOTTOM GRIP 41 | elif position == Qt.BottomEdge: 42 | self.wi.bottom(self) 43 | self.setGeometry(0, self.parent.height() - 10, self.parent.width(), 10) 44 | self.setMaximumHeight(10) 45 | 46 | # GRIPS 47 | self.bottom_left = QSizeGrip(self.wi.bottom_left) 48 | self.bottom_right = QSizeGrip(self.wi.bottom_right) 49 | 50 | # RESIZE BOTTOM 51 | def resize_bottom(event): 52 | delta = event.pos() 53 | height = max(self.parent.minimumHeight(), self.parent.height() + delta.y()) 54 | self.parent.resize(self.parent.width(), height) 55 | event.accept() 56 | self.wi.bottom.mouseMoveEvent = resize_bottom 57 | 58 | # ENABLE COLOR 59 | if disable_color: 60 | self.wi.bottom_left.setStyleSheet("background: transparent") 61 | self.wi.bottom_right.setStyleSheet("background: transparent") 62 | self.wi.bottom.setStyleSheet("background: transparent") 63 | 64 | # SHOW LEFT GRIP 65 | elif position == Qt.LeftEdge: 66 | self.wi.left(self) 67 | self.setGeometry(0, 10, 10, self.parent.height()) 68 | self.setMaximumWidth(10) 69 | 70 | # RESIZE LEFT 71 | def resize_left(event): 72 | delta = event.pos() 73 | width = max(self.parent.minimumWidth(), self.parent.width() - delta.x()) 74 | geo = self.parent.geometry() 75 | geo.setLeft(geo.right() - width) 76 | self.parent.setGeometry(geo) 77 | event.accept() 78 | self.wi.leftgrip.mouseMoveEvent = resize_left 79 | 80 | # ENABLE COLOR 81 | if disable_color: 82 | self.wi.leftgrip.setStyleSheet("background: transparent") 83 | 84 | # RESIZE RIGHT 85 | elif position == Qt.RightEdge: 86 | self.wi.right(self) 87 | self.setGeometry(self.parent.width() - 10, 10, 10, self.parent.height()) 88 | self.setMaximumWidth(10) 89 | 90 | def resize_right(event): 91 | delta = event.pos() 92 | width = max(self.parent.minimumWidth(), self.parent.width() + delta.x()) 93 | self.parent.resize(width, self.parent.height()) 94 | event.accept() 95 | self.wi.rightgrip.mouseMoveEvent = resize_right 96 | 97 | # ENABLE COLOR 98 | if disable_color: 99 | self.wi.rightgrip.setStyleSheet("background: transparent") 100 | 101 | 102 | def mouseReleaseEvent(self, event): 103 | self.mousePos = None 104 | 105 | def resizeEvent(self, event): 106 | if hasattr(self.wi, 'container_top'): 107 | self.wi.container_top.setGeometry(0, 0, self.width(), 10) 108 | 109 | elif hasattr(self.wi, 'container_bottom'): 110 | self.wi.container_bottom.setGeometry(0, 0, self.width(), 10) 111 | 112 | elif hasattr(self.wi, 'leftgrip'): 113 | self.wi.leftgrip.setGeometry(0, 0, 10, self.height() - 20) 114 | 115 | elif hasattr(self.wi, 'rightgrip'): 116 | self.wi.rightgrip.setGeometry(0, 0, 10, self.height() - 20) 117 | 118 | 119 | class Widgets(object): 120 | def top(self, Form): 121 | if not Form.objectName(): 122 | Form.setObjectName(u"Form") 123 | self.container_top = QFrame(Form) 124 | self.container_top.setObjectName(u"container_top") 125 | self.container_top.setGeometry(QRect(0, 0, 500, 10)) 126 | self.container_top.setMinimumSize(QSize(0, 10)) 127 | self.container_top.setMaximumSize(QSize(16777215, 10)) 128 | self.container_top.setFrameShape(QFrame.NoFrame) 129 | self.container_top.setFrameShadow(QFrame.Raised) 130 | self.top_layout = QHBoxLayout(self.container_top) 131 | self.top_layout.setSpacing(0) 132 | self.top_layout.setObjectName(u"top_layout") 133 | self.top_layout.setContentsMargins(0, 0, 0, 0) 134 | self.top_left = QFrame(self.container_top) 135 | self.top_left.setObjectName(u"top_left") 136 | self.top_left.setMinimumSize(QSize(10, 10)) 137 | self.top_left.setMaximumSize(QSize(10, 10)) 138 | self.top_left.setCursor(QCursor(Qt.SizeFDiagCursor)) 139 | self.top_left.setStyleSheet(u"background-color: rgb(33, 37, 43);") 140 | self.top_left.setFrameShape(QFrame.NoFrame) 141 | self.top_left.setFrameShadow(QFrame.Raised) 142 | self.top_layout.addWidget(self.top_left) 143 | self.top = QFrame(self.container_top) 144 | self.top.setObjectName(u"top") 145 | self.top.setCursor(QCursor(Qt.SizeVerCursor)) 146 | self.top.setStyleSheet(u"background-color: rgb(85, 255, 255);") 147 | self.top.setFrameShape(QFrame.NoFrame) 148 | self.top.setFrameShadow(QFrame.Raised) 149 | self.top_layout.addWidget(self.top) 150 | self.top_right = QFrame(self.container_top) 151 | self.top_right.setObjectName(u"top_right") 152 | self.top_right.setMinimumSize(QSize(10, 10)) 153 | self.top_right.setMaximumSize(QSize(10, 10)) 154 | self.top_right.setCursor(QCursor(Qt.SizeBDiagCursor)) 155 | self.top_right.setStyleSheet(u"background-color: rgb(33, 37, 43);") 156 | self.top_right.setFrameShape(QFrame.NoFrame) 157 | self.top_right.setFrameShadow(QFrame.Raised) 158 | self.top_layout.addWidget(self.top_right) 159 | 160 | def bottom(self, Form): 161 | if not Form.objectName(): 162 | Form.setObjectName(u"Form") 163 | self.container_bottom = QFrame(Form) 164 | self.container_bottom.setObjectName(u"container_bottom") 165 | self.container_bottom.setGeometry(QRect(0, 0, 500, 10)) 166 | self.container_bottom.setMinimumSize(QSize(0, 10)) 167 | self.container_bottom.setMaximumSize(QSize(16777215, 10)) 168 | self.container_bottom.setFrameShape(QFrame.NoFrame) 169 | self.container_bottom.setFrameShadow(QFrame.Raised) 170 | self.bottom_layout = QHBoxLayout(self.container_bottom) 171 | self.bottom_layout.setSpacing(0) 172 | self.bottom_layout.setObjectName(u"bottom_layout") 173 | self.bottom_layout.setContentsMargins(0, 0, 0, 0) 174 | self.bottom_left = QFrame(self.container_bottom) 175 | self.bottom_left.setObjectName(u"bottom_left") 176 | self.bottom_left.setMinimumSize(QSize(10, 10)) 177 | self.bottom_left.setMaximumSize(QSize(10, 10)) 178 | self.bottom_left.setCursor(QCursor(Qt.SizeBDiagCursor)) 179 | self.bottom_left.setStyleSheet(u"background-color: rgb(33, 37, 43);") 180 | self.bottom_left.setFrameShape(QFrame.NoFrame) 181 | self.bottom_left.setFrameShadow(QFrame.Raised) 182 | self.bottom_layout.addWidget(self.bottom_left) 183 | self.bottom = QFrame(self.container_bottom) 184 | self.bottom.setObjectName(u"bottom") 185 | self.bottom.setCursor(QCursor(Qt.SizeVerCursor)) 186 | self.bottom.setStyleSheet(u"background-color: rgb(85, 170, 0);") 187 | self.bottom.setFrameShape(QFrame.NoFrame) 188 | self.bottom.setFrameShadow(QFrame.Raised) 189 | self.bottom_layout.addWidget(self.bottom) 190 | self.bottom_right = QFrame(self.container_bottom) 191 | self.bottom_right.setObjectName(u"bottom_right") 192 | self.bottom_right.setMinimumSize(QSize(10, 10)) 193 | self.bottom_right.setMaximumSize(QSize(10, 10)) 194 | self.bottom_right.setCursor(QCursor(Qt.SizeFDiagCursor)) 195 | self.bottom_right.setStyleSheet(u"background-color: rgb(33, 37, 43);") 196 | self.bottom_right.setFrameShape(QFrame.NoFrame) 197 | self.bottom_right.setFrameShadow(QFrame.Raised) 198 | self.bottom_layout.addWidget(self.bottom_right) 199 | 200 | def left(self, Form): 201 | if not Form.objectName(): 202 | Form.setObjectName(u"Form") 203 | self.leftgrip = QFrame(Form) 204 | self.leftgrip.setObjectName(u"left") 205 | self.leftgrip.setGeometry(QRect(0, 10, 10, 480)) 206 | self.leftgrip.setMinimumSize(QSize(10, 0)) 207 | self.leftgrip.setCursor(QCursor(Qt.SizeHorCursor)) 208 | self.leftgrip.setStyleSheet(u"background-color: rgb(255, 121, 198);") 209 | self.leftgrip.setFrameShape(QFrame.NoFrame) 210 | self.leftgrip.setFrameShadow(QFrame.Raised) 211 | 212 | def right(self, Form): 213 | if not Form.objectName(): 214 | Form.setObjectName(u"Form") 215 | Form.resize(500, 500) 216 | self.rightgrip = QFrame(Form) 217 | self.rightgrip.setObjectName(u"right") 218 | self.rightgrip.setGeometry(QRect(0, 0, 10, 500)) 219 | self.rightgrip.setMinimumSize(QSize(10, 0)) 220 | self.rightgrip.setCursor(QCursor(Qt.SizeHorCursor)) 221 | self.rightgrip.setStyleSheet(u"background-color: rgb(255, 0, 127);") 222 | self.rightgrip.setFrameShape(QFrame.NoFrame) 223 | self.rightgrip.setFrameShadow(QFrame.Raised) 224 | -------------------------------------------------------------------------------- /img/IOU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/IOU.png -------------------------------------------------------------------------------- /img/RTSP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/RTSP.png -------------------------------------------------------------------------------- /img/begin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/begin.png -------------------------------------------------------------------------------- /img/box_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/box_down.png -------------------------------------------------------------------------------- /img/box_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/box_up.png -------------------------------------------------------------------------------- /img/cam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/cam.png -------------------------------------------------------------------------------- /img/check_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/check_no.png -------------------------------------------------------------------------------- /img/check_yes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/check_yes.png -------------------------------------------------------------------------------- /img/conf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/conf.png -------------------------------------------------------------------------------- /img/delay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/delay.png -------------------------------------------------------------------------------- /img/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/file.png -------------------------------------------------------------------------------- /img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/home.png -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/logo.png -------------------------------------------------------------------------------- /img/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/menu.png -------------------------------------------------------------------------------- /img/model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/model.png -------------------------------------------------------------------------------- /img/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/pause.png -------------------------------------------------------------------------------- /img/resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/resize.png -------------------------------------------------------------------------------- /img/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/save.png -------------------------------------------------------------------------------- /img/set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/set.png -------------------------------------------------------------------------------- /img/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/img/stop.png -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from ultralytics.yolo.engine.predictor import BasePredictor 2 | from ultralytics.yolo.engine.results import Results 3 | from ultralytics.yolo.utils import DEFAULT_CFG, LOGGER, SETTINGS, callbacks, ops 4 | from ultralytics.yolo.utils.plotting import Annotator, colors, save_one_box 5 | from ultralytics.yolo.utils.torch_utils import smart_inference_mode 6 | from ultralytics.yolo.utils.files import increment_path 7 | from ultralytics.yolo.utils.checks import check_imshow 8 | from ultralytics.yolo.cfg import get_cfg 9 | from PySide6.QtWidgets import QApplication, QMainWindow, QFileDialog, QMenu 10 | from PySide6.QtGui import QImage, QPixmap, QColor 11 | from PySide6.QtCore import QTimer, QThread, Signal, QObject, QPoint, Qt 12 | from ui.CustomMessageBox import MessageBox 13 | from ui.home import Ui_MainWindow 14 | from UIFunctions import * 15 | from collections import defaultdict 16 | from pathlib import Path 17 | from utils.capnums import Camera 18 | from utils.rtsp_win import Window 19 | import numpy as np 20 | import time 21 | import json 22 | import torch 23 | import sys 24 | import cv2 25 | import os 26 | 27 | 28 | class YoloPredictor(BasePredictor, QObject): 29 | yolo2main_pre_img = Signal(np.ndarray) # raw image signal 30 | yolo2main_res_img = Signal(np.ndarray) # test result signal 31 | yolo2main_status_msg = Signal(str) # Detecting/pausing/stopping/testing complete/error reporting signal 32 | yolo2main_fps = Signal(str) # fps 33 | yolo2main_labels = Signal(dict) # Detected target results (number of each category) 34 | yolo2main_progress = Signal(int) # Completeness 35 | yolo2main_class_num = Signal(int) # Number of categories detected 36 | yolo2main_target_num = Signal(int) # Targets detected 37 | 38 | def __init__(self, cfg=DEFAULT_CFG, overrides=None): 39 | super(YoloPredictor, self).__init__() 40 | QObject.__init__(self) 41 | 42 | self.args = get_cfg(cfg, overrides) 43 | project = self.args.project or Path(SETTINGS['runs_dir']) / self.args.task 44 | name = f'{self.args.mode}' 45 | self.save_dir = increment_path(Path(project) / name, exist_ok=self.args.exist_ok) 46 | self.done_warmup = False 47 | if self.args.show: 48 | self.args.show = check_imshow(warn=True) 49 | 50 | # GUI args 51 | self.used_model_name = None # The detection model name to use 52 | self.new_model_name = None # Models that change in real time 53 | self.source = '' # input source 54 | self.stop_dtc = False # Termination detection 55 | self.continue_dtc = True # pause 56 | self.save_res = False # Save test results 57 | self.save_txt = False # save label(txt) file 58 | self.iou_thres = 0.45 # iou 59 | self.conf_thres = 0.25 # conf 60 | self.speed_thres = 10 # delay, ms 61 | self.labels_dict = {} # return a dictionary of results 62 | self.progress_value = 0 # progress bar 63 | 64 | 65 | # Usable if setup is done 66 | self.model = None 67 | self.data = self.args.data # data_dict 68 | self.imgsz = None 69 | self.device = None 70 | self.dataset = None 71 | self.vid_path, self.vid_writer = None, None 72 | self.annotator = None 73 | self.data_path = None 74 | self.source_type = None 75 | self.batch = None 76 | self.callbacks = defaultdict(list, callbacks.default_callbacks) # add callbacks 77 | callbacks.add_integration_callbacks(self) 78 | 79 | # main for detect 80 | @smart_inference_mode() 81 | def run(self): 82 | try: 83 | if self.args.verbose: 84 | LOGGER.info('') 85 | 86 | # set model 87 | self.yolo2main_status_msg.emit('Loding Model...') 88 | if not self.model: 89 | self.setup_model(self.new_model_name) 90 | self.used_model_name = self.new_model_name 91 | 92 | # set source 93 | self.setup_source(self.source if self.source is not None else self.args.source) 94 | 95 | # Check save path/label 96 | if self.save_res or self.save_txt: 97 | (self.save_dir / 'labels' if self.save_txt else self.save_dir).mkdir(parents=True, exist_ok=True) 98 | 99 | # warmup model 100 | if not self.done_warmup: 101 | self.model.warmup(imgsz=(1 if self.model.pt or self.model.triton else self.dataset.bs, 3, *self.imgsz)) 102 | self.done_warmup = True 103 | 104 | self.seen, self.windows, self.dt, self.batch = 0, [], (ops.Profile(), ops.Profile(), ops.Profile()), None 105 | 106 | # start detection 107 | # for batch in self.dataset: 108 | 109 | 110 | count = 0 # run location frame 111 | start_time = time.time() # used to calculate the frame rate 112 | batch = iter(self.dataset) 113 | while True: 114 | # Termination detection 115 | if self.stop_dtc: 116 | if isinstance(self.vid_writer[-1], cv2.VideoWriter): 117 | self.vid_writer[-1].release() # release final video writer 118 | self.yolo2main_status_msg.emit('Detection terminated!') 119 | break 120 | 121 | # Change the model midway 122 | if self.used_model_name != self.new_model_name: 123 | # self.yolo2main_status_msg.emit('Change Model...') 124 | self.setup_model(self.new_model_name) 125 | self.used_model_name = self.new_model_name 126 | 127 | # pause switch 128 | if self.continue_dtc: 129 | # time.sleep(0.001) 130 | self.yolo2main_status_msg.emit('Detecting...') 131 | batch = next(self.dataset) # next data 132 | 133 | self.batch = batch 134 | path, im, im0s, vid_cap, s = batch 135 | visualize = increment_path(self.save_dir / Path(path).stem, mkdir=True) if self.args.visualize else False 136 | 137 | # Calculation completion and frame rate (to be optimized) 138 | count += 1 # frame count +1 139 | if vid_cap: 140 | all_count = vid_cap.get(cv2.CAP_PROP_FRAME_COUNT) # total frames 141 | else: 142 | all_count = 1 143 | self.progress_value = int(count/all_count*1000) # progress bar(0~1000) 144 | if count % 5 == 0 and count >= 5: # Calculate the frame rate every 5 frames 145 | self.yolo2main_fps.emit(str(int(5/(time.time()-start_time)))) 146 | start_time = time.time() 147 | 148 | # preprocess 149 | with self.dt[0]: 150 | im = self.preprocess(im) 151 | if len(im.shape) == 3: 152 | im = im[None] # expand for batch dim 153 | # inference 154 | with self.dt[1]: 155 | preds = self.model(im, augment=self.args.augment, visualize=visualize) 156 | # postprocess 157 | with self.dt[2]: 158 | self.results = self.postprocess(preds, im, im0s) 159 | 160 | # visualize, save, write results 161 | n = len(im) # To be improved: support multiple img 162 | for i in range(n): 163 | self.results[i].speed = { 164 | 'preprocess': self.dt[0].dt * 1E3 / n, 165 | 'inference': self.dt[1].dt * 1E3 / n, 166 | 'postprocess': self.dt[2].dt * 1E3 / n} 167 | p, im0 = (path[i], im0s[i].copy()) if self.source_type.webcam or self.source_type.from_img \ 168 | else (path, im0s.copy()) 169 | p = Path(p) # the source dir 170 | 171 | # s::: video 1/1 (6/6557) 'path': 172 | # must, to get boxs\labels 173 | label_str = self.write_results(i, self.results, (p, im, im0)) # labels /// original :s += 174 | 175 | # labels and nums dict 176 | class_nums = 0 177 | target_nums = 0 178 | self.labels_dict = {} 179 | if 'no detections' in label_str: 180 | pass 181 | else: 182 | for ii in label_str.split(',')[:-1]: 183 | nums, label_name = ii.split('~') 184 | self.labels_dict[label_name] = int(nums) 185 | target_nums += int(nums) 186 | class_nums += 1 187 | 188 | # save img or video result 189 | if self.save_res: 190 | self.save_preds(vid_cap, i, str(self.save_dir / p.name)) 191 | 192 | # Send test results 193 | self.yolo2main_res_img.emit(im0) # after detection 194 | self.yolo2main_pre_img.emit(im0s if isinstance(im0s, np.ndarray) else im0s[0]) # Before testing 195 | # self.yolo2main_labels.emit(self.labels_dict) # webcam need to change the def write_results 196 | self.yolo2main_class_num.emit(class_nums) 197 | self.yolo2main_target_num.emit(target_nums) 198 | 199 | if self.speed_thres != 0: 200 | time.sleep(self.speed_thres/1000) # delay , ms 201 | 202 | self.yolo2main_progress.emit(self.progress_value) # progress bar 203 | 204 | # Detection completed 205 | if count + 1 >= all_count: 206 | if isinstance(self.vid_writer[-1], cv2.VideoWriter): 207 | self.vid_writer[-1].release() # release final video writer 208 | self.yolo2main_status_msg.emit('Detection completed') 209 | break 210 | 211 | except Exception as e: 212 | pass 213 | print(e) 214 | self.yolo2main_status_msg.emit('%s' % e) 215 | 216 | 217 | def get_annotator(self, img): 218 | return Annotator(img, line_width=self.args.line_thickness, example=str(self.model.names)) 219 | 220 | def preprocess(self, img): 221 | img = torch.from_numpy(img).to(self.model.device) 222 | img = img.half() if self.model.fp16 else img.float() # uint8 to fp16/32 223 | img /= 255 # 0 - 255 to 0.0 - 1.0 224 | return img 225 | 226 | def postprocess(self, preds, img, orig_img): 227 | ### important 228 | preds = ops.non_max_suppression(preds, 229 | self.conf_thres, 230 | self.iou_thres, 231 | agnostic=self.args.agnostic_nms, 232 | max_det=self.args.max_det, 233 | classes=self.args.classes) 234 | 235 | results = [] 236 | for i, pred in enumerate(preds): 237 | orig_img = orig_img[i] if isinstance(orig_img, list) else orig_img 238 | shape = orig_img.shape 239 | pred[:, :4] = ops.scale_boxes(img.shape[2:], pred[:, :4], shape).round() 240 | path, _, _, _, _ = self.batch 241 | img_path = path[i] if isinstance(path, list) else path 242 | results.append(Results(orig_img=orig_img, path=img_path, names=self.model.names, boxes=pred)) 243 | # print(results) 244 | return results 245 | 246 | def write_results(self, idx, results, batch): 247 | p, im, im0 = batch 248 | log_string = '' 249 | if len(im.shape) == 3: 250 | im = im[None] # expand for batch dim 251 | self.seen += 1 252 | imc = im0.copy() if self.args.save_crop else im0 253 | if self.source_type.webcam or self.source_type.from_img: # batch_size >= 1 # attention 254 | log_string += f'{idx}: ' 255 | frame = self.dataset.count 256 | else: 257 | frame = getattr(self.dataset, 'frame', 0) 258 | self.data_path = p 259 | self.txt_path = str(self.save_dir / 'labels' / p.stem) + ('' if self.dataset.mode == 'image' else f'_{frame}') 260 | # log_string += '%gx%g ' % im.shape[2:] # !!! don't add img size~ 261 | self.annotator = self.get_annotator(im0) 262 | 263 | det = results[idx].boxes # TODO: make boxes inherit from tensors 264 | 265 | if len(det) == 0: 266 | return f'{log_string}(no detections), ' # if no, send this~~ 267 | 268 | for c in det.cls.unique(): 269 | n = (det.cls == c).sum() # detections per class 270 | log_string += f"{n}~{self.model.names[int(c)]}," # {'s' * (n > 1)}, " # don't add 's' 271 | # now log_string is the classes 👆 272 | 273 | 274 | # write 275 | for d in reversed(det): 276 | cls, conf = d.cls.squeeze(), d.conf.squeeze() 277 | if self.save_txt: # Write to file 278 | line = (cls, *(d.xywhn.view(-1).tolist()), conf) \ 279 | if self.args.save_conf else (cls, *(d.xywhn.view(-1).tolist())) # label format 280 | with open(f'{self.txt_path}.txt', 'a') as f: 281 | f.write(('%g ' * len(line)).rstrip() % line + '\n') 282 | if self.save_res or self.args.save_crop or self.args.show or True: # Add bbox to image(must) 283 | c = int(cls) # integer class 284 | name = f'id:{int(d.id.item())} {self.model.names[c]}' if d.id is not None else self.model.names[c] 285 | label = None if self.args.hide_labels else (name if self.args.hide_conf else f'{name} {conf:.2f}') 286 | self.annotator.box_label(d.xyxy.squeeze(), label, color=colors(c, True)) 287 | if self.args.save_crop: 288 | save_one_box(d.xyxy, 289 | imc, 290 | file=self.save_dir / 'crops' / self.model.model.names[c] / f'{self.data_path.stem}.jpg', 291 | BGR=True) 292 | 293 | return log_string 294 | 295 | 296 | 297 | class MainWindow(QMainWindow, Ui_MainWindow): 298 | main2yolo_begin_sgl = Signal() # The main window sends an execution signal to the yolo instance 299 | def __init__(self, parent=None): 300 | super(MainWindow, self).__init__(parent) 301 | # basic interface 302 | self.setupUi(self) 303 | self.setAttribute(Qt.WA_TranslucentBackground) # rounded transparent 304 | self.setWindowFlags(Qt.FramelessWindowHint) # Set window flag: hide window borders 305 | UIFuncitons.uiDefinitions(self) 306 | # Show module shadows 307 | UIFuncitons.shadow_style(self, self.Class_QF, QColor(162,129,247)) 308 | UIFuncitons.shadow_style(self, self.Target_QF, QColor(251, 157, 139)) 309 | UIFuncitons.shadow_style(self, self.Fps_QF, QColor(170, 128, 213)) 310 | UIFuncitons.shadow_style(self, self.Model_QF, QColor(64, 186, 193)) 311 | 312 | 313 | 314 | # read model folder 315 | self.pt_list = os.listdir('./models') 316 | self.pt_list = [file for file in self.pt_list if file.endswith('.pt')] 317 | self.pt_list.sort(key=lambda x: os.path.getsize('./models/' + x)) # sort by file size 318 | self.model_box.clear() 319 | self.model_box.addItems(self.pt_list) 320 | self.Qtimer_ModelBox = QTimer(self) # Timer: Monitor model file changes every 2 seconds 321 | self.Qtimer_ModelBox.timeout.connect(self.ModelBoxRefre) 322 | self.Qtimer_ModelBox.start(2000) 323 | 324 | # Yolo-v8 thread 325 | self.yolo_predict = YoloPredictor() # Create a Yolo instance 326 | self.select_model = self.model_box.currentText() # default model 327 | self.yolo_predict.new_model_name = "./models/%s" % self.select_model 328 | self.yolo_thread = QThread() # Create yolo thread 329 | self.yolo_predict.yolo2main_pre_img.connect(lambda x: self.show_image(x, self.pre_video)) 330 | self.yolo_predict.yolo2main_res_img.connect(lambda x: self.show_image(x, self.res_video)) 331 | self.yolo_predict.yolo2main_status_msg.connect(lambda x: self.show_status(x)) 332 | self.yolo_predict.yolo2main_fps.connect(lambda x: self.fps_label.setText(x)) 333 | # self.yolo_predict.yolo2main_labels.connect(self.show_labels) 334 | self.yolo_predict.yolo2main_class_num.connect(lambda x:self.Class_num.setText(str(x))) 335 | self.yolo_predict.yolo2main_target_num.connect(lambda x:self.Target_num.setText(str(x))) 336 | self.yolo_predict.yolo2main_progress.connect(lambda x: self.progress_bar.setValue(x)) 337 | self.main2yolo_begin_sgl.connect(self.yolo_predict.run) 338 | self.yolo_predict.moveToThread(self.yolo_thread) 339 | 340 | # Model parameters 341 | self.model_box.currentTextChanged.connect(self.change_model) 342 | self.iou_spinbox.valueChanged.connect(lambda x:self.change_val(x, 'iou_spinbox')) # iou box 343 | self.iou_slider.valueChanged.connect(lambda x:self.change_val(x, 'iou_slider')) # iou scroll bar 344 | self.conf_spinbox.valueChanged.connect(lambda x:self.change_val(x, 'conf_spinbox')) # conf box 345 | self.conf_slider.valueChanged.connect(lambda x:self.change_val(x, 'conf_slider')) # conf scroll bar 346 | self.speed_spinbox.valueChanged.connect(lambda x:self.change_val(x, 'speed_spinbox'))# speed box 347 | self.speed_slider.valueChanged.connect(lambda x:self.change_val(x, 'speed_slider')) # speed scroll bar 348 | 349 | # Prompt window initialization 350 | self.Class_num.setText('--') 351 | self.Target_num.setText('--') 352 | self.fps_label.setText('--') 353 | self.Model_name.setText(self.select_model) 354 | 355 | # Select detection source 356 | self.src_file_button.clicked.connect(self.open_src_file) # select local file 357 | # self.src_cam_button.clicked.connect(self.show_status("The function has not yet been implemented."))#chose_cam 358 | # self.src_rtsp_button.clicked.connect(self.show_status("The function has not yet been implemented."))#chose_rtsp 359 | 360 | # start testing button 361 | self.run_button.clicked.connect(self.run_or_continue) # pause/start 362 | self.stop_button.clicked.connect(self.stop) # termination 363 | 364 | # Other function buttons 365 | self.save_res_button.toggled.connect(self.is_save_res) # save image option 366 | self.save_txt_button.toggled.connect(self.is_save_txt) # Save label option 367 | self.ToggleBotton.clicked.connect(lambda: UIFuncitons.toggleMenu(self, True)) # left navigation button 368 | self.settings_button.clicked.connect(lambda: UIFuncitons.settingBox(self, True)) # top right settings button 369 | 370 | # initialization 371 | self.load_config() 372 | 373 | # The main window displays the original image and detection results 374 | @staticmethod 375 | def show_image(img_src, label): 376 | try: 377 | ih, iw, _ = img_src.shape 378 | w = label.geometry().width() 379 | h = label.geometry().height() 380 | # keep the original data ratio 381 | if iw/w > ih/h: 382 | scal = w / iw 383 | nw = w 384 | nh = int(scal * ih) 385 | img_src_ = cv2.resize(img_src, (nw, nh)) 386 | 387 | else: 388 | scal = h / ih 389 | nw = int(scal * iw) 390 | nh = h 391 | img_src_ = cv2.resize(img_src, (nw, nh)) 392 | 393 | frame = cv2.cvtColor(img_src_, cv2.COLOR_BGR2RGB) 394 | img = QImage(frame.data, frame.shape[1], frame.shape[0], frame.shape[2] * frame.shape[1], 395 | QImage.Format_RGB888) 396 | label.setPixmap(QPixmap.fromImage(img)) 397 | 398 | except Exception as e: 399 | print(repr(e)) 400 | 401 | # Control start/pause 402 | def run_or_continue(self): 403 | if self.yolo_predict.source == '': 404 | self.show_status('Please select a video source before starting detection...') 405 | self.run_button.setChecked(False) 406 | else: 407 | self.yolo_predict.stop_dtc = False 408 | if self.run_button.isChecked(): 409 | self.run_button.setChecked(True) # start button 410 | self.save_txt_button.setEnabled(False) # It is forbidden to check and save after starting the detection 411 | self.save_res_button.setEnabled(False) 412 | self.show_status('Detecting...') 413 | self.yolo_predict.continue_dtc = True # Control whether Yolo is paused 414 | if not self.yolo_thread.isRunning(): 415 | self.yolo_thread.start() 416 | self.main2yolo_begin_sgl.emit() 417 | 418 | else: 419 | self.yolo_predict.continue_dtc = False 420 | self.show_status("Pause...") 421 | self.run_button.setChecked(False) # start button 422 | 423 | # bottom status bar information 424 | def show_status(self, msg): 425 | self.status_bar.setText(msg) 426 | if msg == 'Detection completed' or msg == '检测完成': 427 | self.save_res_button.setEnabled(True) 428 | self.save_txt_button.setEnabled(True) 429 | self.run_button.setChecked(False) 430 | self.progress_bar.setValue(0) 431 | if self.yolo_thread.isRunning(): 432 | self.yolo_thread.quit() # end process 433 | elif msg == 'Detection terminated!' or msg == '检测终止': 434 | self.save_res_button.setEnabled(True) 435 | self.save_txt_button.setEnabled(True) 436 | self.run_button.setChecked(False) 437 | self.progress_bar.setValue(0) 438 | if self.yolo_thread.isRunning(): 439 | self.yolo_thread.quit() # end process 440 | self.pre_video.clear() # clear image display 441 | self.res_video.clear() 442 | self.Class_num.setText('--') 443 | self.Target_num.setText('--') 444 | self.fps_label.setText('--') 445 | 446 | # select local file 447 | def open_src_file(self): 448 | config_file = 'config/fold.json' 449 | config = json.load(open(config_file, 'r', encoding='utf-8')) 450 | open_fold = config['open_fold'] 451 | if not os.path.exists(open_fold): 452 | open_fold = os.getcwd() 453 | name, _ = QFileDialog.getOpenFileName(self, 'Video/image', open_fold, "Pic File(*.mp4 *.mkv *.avi *.flv *.jpg *.png)") 454 | if name: 455 | self.yolo_predict.source = name 456 | self.show_status('Load File:{}'.format(os.path.basename(name))) 457 | config['open_fold'] = os.path.dirname(name) 458 | config_json = json.dumps(config, ensure_ascii=False, indent=2) 459 | with open(config_file, 'w', encoding='utf-8') as f: 460 | f.write(config_json) 461 | self.stop() 462 | 463 | # Select camera source---- have one bug 464 | def chose_cam(self): 465 | try: 466 | self.stop() 467 | MessageBox( 468 | self.close_button, title='Note', text='loading camera...', time=2000, auto=True).exec() 469 | # get the number of local cameras 470 | _, cams = Camera().get_cam_num() 471 | popMenu = QMenu() 472 | popMenu.setFixedWidth(self.src_cam_button.width()) 473 | popMenu.setStyleSheet(''' 474 | QMenu { 475 | font-size: 16px; 476 | font-family: "Microsoft YaHei UI"; 477 | font-weight: light; 478 | color:white; 479 | padding-left: 5px; 480 | padding-right: 5px; 481 | padding-top: 4px; 482 | padding-bottom: 4px; 483 | border-style: solid; 484 | border-width: 0px; 485 | border-color: rgba(255, 255, 255, 255); 486 | border-radius: 3px; 487 | background-color: rgba(200, 200, 200,50);} 488 | ''') 489 | 490 | for cam in cams: 491 | exec("action_%s = QAction('%s')" % (cam, cam)) 492 | exec("popMenu.addAction(action_%s)" % cam) 493 | 494 | x = self.src_cam_button.mapToGlobal(self.src_cam_button.pos()).x() 495 | y = self.src_cam_button.mapToGlobal(self.src_cam_button.pos()).y() 496 | y = y + self.src_cam_button.frameGeometry().height() 497 | pos = QPoint(x, y) 498 | action = popMenu.exec(pos) 499 | if action: 500 | self.yolo_predict.source = action.text() 501 | self.show_status('Loading camera:{}'.format(action.text())) 502 | 503 | except Exception as e: 504 | self.show_status('%s' % e) 505 | 506 | # select network source 507 | def chose_rtsp(self): 508 | self.rtsp_window = Window() 509 | config_file = 'config/ip.json' 510 | if not os.path.exists(config_file): 511 | ip = "rtsp://admin:admin888@192.168.1.2:555" 512 | new_config = {"ip": ip} 513 | new_json = json.dumps(new_config, ensure_ascii=False, indent=2) 514 | with open(config_file, 'w', encoding='utf-8') as f: 515 | f.write(new_json) 516 | else: 517 | config = json.load(open(config_file, 'r', encoding='utf-8')) 518 | ip = config['ip'] 519 | self.rtsp_window.rtspEdit.setText(ip) 520 | self.rtsp_window.show() 521 | self.rtsp_window.rtspButton.clicked.connect(lambda: self.load_rtsp(self.rtsp_window.rtspEdit.text())) 522 | 523 | # load network sources 524 | def load_rtsp(self, ip): 525 | try: 526 | self.stop() 527 | MessageBox( 528 | self.close_button, title='提示', text='加载 rtsp...', time=1000, auto=True).exec() 529 | self.yolo_predict.source = ip 530 | new_config = {"ip": ip} 531 | new_json = json.dumps(new_config, ensure_ascii=False, indent=2) 532 | with open('config/ip.json', 'w', encoding='utf-8') as f: 533 | f.write(new_json) 534 | self.show_status('Loading rtsp:{}'.format(ip)) 535 | self.rtsp_window.close() 536 | except Exception as e: 537 | self.show_status('%s' % e) 538 | 539 | # Save test result button--picture/video 540 | def is_save_res(self): 541 | if self.save_res_button.checkState() == Qt.CheckState.Unchecked: 542 | self.show_status('NOTE: Run image results are not saved.') 543 | self.yolo_predict.save_res = False 544 | elif self.save_res_button.checkState() == Qt.CheckState.Checked: 545 | self.show_status('NOTE: Run image results will be saved.') 546 | self.yolo_predict.save_res = True 547 | 548 | # Save test result button -- label (txt) 549 | def is_save_txt(self): 550 | if self.save_txt_button.checkState() == Qt.CheckState.Unchecked: 551 | self.show_status('NOTE: Labels results are not saved.') 552 | self.yolo_predict.save_txt = False 553 | elif self.save_txt_button.checkState() == Qt.CheckState.Checked: 554 | self.show_status('NOTE: Labels results will be saved.') 555 | self.yolo_predict.save_txt = True 556 | 557 | # Configuration initialization ~~~wait to change~~~ 558 | def load_config(self): 559 | config_file = 'config/setting.json' 560 | if not os.path.exists(config_file): 561 | iou = 0.26 562 | conf = 0.33 563 | rate = 10 564 | save_res = 0 565 | save_txt = 0 566 | new_config = {"iou": iou, 567 | "conf": conf, 568 | "rate": rate, 569 | "save_res": save_res, 570 | "save_txt": save_txt 571 | } 572 | new_json = json.dumps(new_config, ensure_ascii=False, indent=2) 573 | with open(config_file, 'w', encoding='utf-8') as f: 574 | f.write(new_json) 575 | else: 576 | config = json.load(open(config_file, 'r', encoding='utf-8')) 577 | if len(config) != 5: 578 | iou = 0.26 579 | conf = 0.33 580 | rate = 10 581 | save_res = 0 582 | save_txt = 0 583 | else: 584 | iou = config['iou'] 585 | conf = config['conf'] 586 | rate = config['rate'] 587 | save_res = config['save_res'] 588 | save_txt = config['save_txt'] 589 | self.save_res_button.setCheckState(Qt.CheckState(save_res)) 590 | self.yolo_predict.save_res = (False if save_res==0 else True ) 591 | self.save_txt_button.setCheckState(Qt.CheckState(save_txt)) 592 | self.yolo_predict.save_txt = (False if save_txt==0 else True ) 593 | self.run_button.setChecked(False) 594 | self.show_status("Welcome~") 595 | 596 | # Terminate button and associated state 597 | def stop(self): 598 | if self.yolo_thread.isRunning(): 599 | self.yolo_thread.quit() # end thread 600 | self.yolo_predict.stop_dtc = True 601 | self.run_button.setChecked(False) # start key recovery 602 | self.save_res_button.setEnabled(True) # Ability to use the save button 603 | self.save_txt_button.setEnabled(True) # Ability to use the save button 604 | self.pre_video.clear() # clear image display 605 | self.res_video.clear() # clear image display 606 | self.progress_bar.setValue(0) 607 | self.Class_num.setText('--') 608 | self.Target_num.setText('--') 609 | self.fps_label.setText('--') 610 | 611 | # Change detection parameters 612 | def change_val(self, x, flag): 613 | if flag == 'iou_spinbox': 614 | self.iou_slider.setValue(int(x*100)) # The box value changes, changing the slider 615 | elif flag == 'iou_slider': 616 | self.iou_spinbox.setValue(x/100) # The slider value changes, changing the box 617 | self.show_status('IOU Threshold: %s' % str(x/100)) 618 | self.yolo_predict.iou_thres = x/100 619 | elif flag == 'conf_spinbox': 620 | self.conf_slider.setValue(int(x*100)) 621 | elif flag == 'conf_slider': 622 | self.conf_spinbox.setValue(x/100) 623 | self.show_status('Conf Threshold: %s' % str(x/100)) 624 | self.yolo_predict.conf_thres = x/100 625 | elif flag == 'speed_spinbox': 626 | self.speed_slider.setValue(x) 627 | elif flag == 'speed_slider': 628 | self.speed_spinbox.setValue(x) 629 | self.show_status('Delay: %s ms' % str(x)) 630 | self.yolo_predict.speed_thres = x # ms 631 | 632 | # change model 633 | def change_model(self,x): 634 | self.select_model = self.model_box.currentText() 635 | self.yolo_predict.new_model_name = "./models/%s" % self.select_model 636 | self.show_status('Change Model:%s' % self.select_model) 637 | self.Model_name.setText(self.select_model) 638 | 639 | # label result 640 | # def show_labels(self, labels_dic): 641 | # try: 642 | # self.result_label.clear() 643 | # labels_dic = sorted(labels_dic.items(), key=lambda x: x[1], reverse=True) 644 | # labels_dic = [i for i in labels_dic if i[1]>0] 645 | # result = [' '+str(i[0]) + ':' + str(i[1]) for i in labels_dic] 646 | # self.result_label.addItems(result) 647 | # except Exception as e: 648 | # self.show_status(e) 649 | 650 | # Cycle monitoring model file changes 651 | def ModelBoxRefre(self): 652 | pt_list = os.listdir('./models') 653 | pt_list = [file for file in pt_list if file.endswith('.pt')] 654 | pt_list.sort(key=lambda x: os.path.getsize('./models/' + x)) 655 | # It must be sorted before comparing, otherwise the list will be refreshed all the time 656 | if pt_list != self.pt_list: 657 | self.pt_list = pt_list 658 | self.model_box.clear() 659 | self.model_box.addItems(self.pt_list) 660 | 661 | # Get the mouse position (used to hold down the title bar and drag the window) 662 | def mousePressEvent(self, event): 663 | p = event.globalPosition() 664 | globalPos = p.toPoint() 665 | self.dragPos = globalPos 666 | 667 | # Optimize the adjustment when dragging the bottom and right edges of the window size 668 | def resizeEvent(self, event): 669 | # Update Size Grips 670 | UIFuncitons.resize_grips(self) 671 | 672 | # Exit Exit thread, save settings 673 | def closeEvent(self, event): 674 | config_file = 'config/setting.json' 675 | config = dict() 676 | config['iou'] = self.iou_spinbox.value() 677 | config['conf'] = self.conf_spinbox.value() 678 | config['rate'] = self.speed_spinbox.value() 679 | config['save_res'] = (0 if self.save_res_button.checkState()==Qt.Unchecked else 2) 680 | config['save_txt'] = (0 if self.save_txt_button.checkState()==Qt.Unchecked else 2) 681 | config_json = json.dumps(config, ensure_ascii=False, indent=2) 682 | with open(config_file, 'w', encoding='utf-8') as f: 683 | f.write(config_json) 684 | # Exit the process before closing 685 | if self.yolo_thread.isRunning(): 686 | self.yolo_predict.stop_dtc = True 687 | self.yolo_thread.quit() 688 | MessageBox( 689 | self.close_button, title='Note', text='Exiting, please wait...', time=3000, auto=True).exec() 690 | sys.exit(0) 691 | else: 692 | sys.exit(0) 693 | 694 | 695 | if __name__ == "__main__": 696 | app = QApplication(sys.argv) 697 | Home = MainWindow() 698 | Home.show() 699 | sys.exit(app.exec()) 700 | -------------------------------------------------------------------------------- /models/yolov8n.pt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/models/yolov8n.pt -------------------------------------------------------------------------------- /resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | img/pause.png 4 | img/model.png 5 | img/save.png 6 | img/check_yes.png 7 | img/check_no.png 8 | img/delay.png 9 | img/conf.png 10 | img/box_down.png 11 | img/box_up.png 12 | img/IOU.png 13 | img/stop.png 14 | img/begin.png 15 | img/set.png 16 | img/menu.png 17 | img/file.png 18 | img/cam.png 19 | img/logo.png 20 | img/RTSP.png 21 | 22 | 23 | -------------------------------------------------------------------------------- /test-img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jai-wei/YOLOv8-PySide6-GUI/db7724605d84ee55f056423c329800ff5835e050/test-img.jpg -------------------------------------------------------------------------------- /ui/CustomMessageBox.py: -------------------------------------------------------------------------------- 1 | from PySide6.QtCore import QTimer, Qt 2 | from PySide6.QtWidgets import QMessageBox 3 | from PySide6.QtGui import QPixmap, QIcon 4 | 5 | 6 | # Single-button dialog box, which disappears automatically after appearing for a specified period of time 7 | class MessageBox(QMessageBox): 8 | def __init__(self, *args, title='提示', count=1, time=1000, auto=False, **kwargs): 9 | super(MessageBox, self).__init__(*args, **kwargs) 10 | self._count = count 11 | self._time = time 12 | self._auto = auto # Whether to close automatically 13 | assert count > 0 # must be greater than 0 14 | assert time >= 500 # Must be >=500 milliseconds 15 | self.setStyleSheet(''' 16 | QWidget{color:black; 17 | background-color: qlineargradient(x0:0, y0:1, x1:1, y1:1,stop:0.4 rgb(107, 128, 210),stop:1 rgb(180, 140, 255)); 18 | font: 13pt "Microsoft YaHei UI"; 19 | padding-right: 5px; 20 | padding-top: 14px; 21 | font-weight: light;} 22 | QLabel{ 23 | color:white; 24 | background-color: rgba(107, 128, 210, 0);}''') 25 | 26 | self.setWindowTitle(title) 27 | 28 | self.setStandardButtons(QMessageBox.StandardButton.Close) # close button 29 | self.closeBtn = self.button(QMessageBox.StandardButton.Close) # get close button 30 | self.closeBtn.setText('Close') 31 | self.closeBtn.setVisible(False) 32 | self._timer = QTimer(self, timeout=self.doCountDown) 33 | self._timer.start(self._time) 34 | 35 | def doCountDown(self): 36 | self._count -= 1 37 | if self._count <= 0: 38 | self._timer.stop() 39 | if self._auto: # auto close 40 | self.accept() 41 | self.close() 42 | 43 | if __name__ == '__main__': 44 | MessageBox(QWidget=None, text='123', auto=True).exec() 45 | -------------------------------------------------------------------------------- /ui/home.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | ################################################################################ 4 | ## Form generated from reading UI file 'home.ui' 5 | ## 6 | ## Created by: Qt User Interface Compiler version 6.4.2 7 | ## 8 | ## WARNING! All changes made in this file will be lost when recompiling UI file! 9 | ################################################################################ 10 | 11 | from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, 12 | QMetaObject, QObject, QPoint, QRect, 13 | QSize, QTime, QUrl, Qt) 14 | from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, 15 | QFont, QFontDatabase, QGradient, QIcon, 16 | QImage, QKeySequence, QLinearGradient, QPainter, 17 | QPalette, QPixmap, QRadialGradient, QTransform) 18 | from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QDoubleSpinBox, 19 | QFrame, QHBoxLayout, QLabel, QLayout, 20 | QMainWindow, QProgressBar, QPushButton, QSizePolicy, 21 | QSlider, QSpacerItem, QSpinBox, QSplitter, 22 | QVBoxLayout, QWidget) 23 | import ui.resources_rc 24 | 25 | class Ui_MainWindow(object): 26 | def setupUi(self, MainWindow): 27 | if not MainWindow.objectName(): 28 | MainWindow.setObjectName(u"MainWindow") 29 | MainWindow.resize(1220, 725) 30 | self.Main_QW = QWidget(MainWindow) 31 | self.Main_QW.setObjectName(u"Main_QW") 32 | self.verticalLayout = QVBoxLayout(self.Main_QW) 33 | self.verticalLayout.setSpacing(0) 34 | self.verticalLayout.setObjectName(u"verticalLayout") 35 | self.verticalLayout.setContentsMargins(0, 0, 0, 0) 36 | self.Main_QF = QFrame(self.Main_QW) 37 | self.Main_QF.setObjectName(u"Main_QF") 38 | self.Main_QF.setStyleSheet(u"QFrame#Main_QF{\n" 39 | " background-color: qlineargradient(x0:0, y0:1, x1:1, y1:1,stop:0.4 rgb(107, 128, 210), stop:1 rgb(180, 140, 255));\n" 40 | "border:0px solid red;\n" 41 | "border-radius:30px\n" 42 | "}") 43 | self.main_qframe = QHBoxLayout(self.Main_QF) 44 | self.main_qframe.setSpacing(0) 45 | self.main_qframe.setObjectName(u"main_qframe") 46 | self.main_qframe.setContentsMargins(0, 0, 0, 0) 47 | self.LeftMenuBg = QFrame(self.Main_QF) 48 | self.LeftMenuBg.setObjectName(u"LeftMenuBg") 49 | self.LeftMenuBg.setMinimumSize(QSize(68, 0)) 50 | self.LeftMenuBg.setMaximumSize(QSize(68, 16777215)) 51 | self.LeftMenuBg.setStyleSheet(u"QFrame#LeftMenuBg{\n" 52 | " background-color: rgba(255, 255, 255,0);\n" 53 | "border:0px solid red;\n" 54 | "border-radius:30px\n" 55 | "}") 56 | self.LeftMenuBg.setFrameShape(QFrame.NoFrame) 57 | self.LeftMenuBg.setFrameShadow(QFrame.Raised) 58 | self.verticalLayout_2 = QVBoxLayout(self.LeftMenuBg) 59 | self.verticalLayout_2.setSpacing(0) 60 | self.verticalLayout_2.setObjectName(u"verticalLayout_2") 61 | self.verticalLayout_2.setContentsMargins(0, 0, 0, -1) 62 | self.TopLogoInfo = QFrame(self.LeftMenuBg) 63 | self.TopLogoInfo.setObjectName(u"TopLogoInfo") 64 | self.TopLogoInfo.setEnabled(True) 65 | self.TopLogoInfo.setMinimumSize(QSize(0, 70)) 66 | self.TopLogoInfo.setMaximumSize(QSize(16777215, 70)) 67 | self.TopLogoInfo.setFrameShape(QFrame.StyledPanel) 68 | self.TopLogoInfo.setFrameShadow(QFrame.Raised) 69 | self.logo = QWidget(self.TopLogoInfo) 70 | self.logo.setObjectName(u"logo") 71 | self.logo.setGeometry(QRect(10, 10, 50, 50)) 72 | sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) 73 | sizePolicy.setHorizontalStretch(0) 74 | sizePolicy.setVerticalStretch(0) 75 | sizePolicy.setHeightForWidth(self.logo.sizePolicy().hasHeightForWidth()) 76 | self.logo.setSizePolicy(sizePolicy) 77 | self.logo.setMinimumSize(QSize(50, 50)) 78 | self.logo.setMaximumSize(QSize(50, 50)) 79 | self.logo.setStyleSheet(u"image: url(:/all/img/logo.png);\n" 80 | "border:2px solid rgb(255, 255, 255);\n" 81 | "border-radius:10px") 82 | self.Author = QLabel(self.TopLogoInfo) 83 | self.Author.setObjectName(u"Author") 84 | self.Author.setGeometry(QRect(90, 30, 60, 30)) 85 | sizePolicy.setHeightForWidth(self.Author.sizePolicy().hasHeightForWidth()) 86 | self.Author.setSizePolicy(sizePolicy) 87 | self.Author.setMinimumSize(QSize(60, 30)) 88 | self.Author.setMaximumSize(QSize(60, 30)) 89 | self.Author.setStyleSheet(u"font: italic 11pt \"Segoe UI\";\n" 90 | "color: rgba(255, 255, 255, 255);") 91 | self.Author.setAlignment(Qt.AlignCenter) 92 | self.Title = QLabel(self.TopLogoInfo) 93 | self.Title.setObjectName(u"Title") 94 | self.Title.setGeometry(QRect(60, 10, 121, 20)) 95 | self.Title.setMaximumSize(QSize(16777215, 30)) 96 | self.Title.setStyleSheet(u"font: 600 13pt \"Segoe UI Semibold\";\n" 97 | "color: rgba(255, 255, 255, 255);") 98 | self.Title.setAlignment(Qt.AlignCenter) 99 | 100 | self.verticalLayout_2.addWidget(self.TopLogoInfo) 101 | 102 | self.ToggleBox = QFrame(self.LeftMenuBg) 103 | self.ToggleBox.setObjectName(u"ToggleBox") 104 | self.ToggleBox.setMinimumSize(QSize(200, 80)) 105 | self.ToggleBox.setMaximumSize(QSize(200, 80)) 106 | self.ToggleBox.setFrameShape(QFrame.NoFrame) 107 | self.ToggleBox.setFrameShadow(QFrame.Raised) 108 | self.verticalLayout_4 = QVBoxLayout(self.ToggleBox) 109 | self.verticalLayout_4.setSpacing(0) 110 | self.verticalLayout_4.setObjectName(u"verticalLayout_4") 111 | self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) 112 | self.ToggleBotton = QPushButton(self.ToggleBox) 113 | self.ToggleBotton.setObjectName(u"ToggleBotton") 114 | sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) 115 | sizePolicy1.setHorizontalStretch(0) 116 | sizePolicy1.setVerticalStretch(0) 117 | sizePolicy1.setHeightForWidth(self.ToggleBotton.sizePolicy().hasHeightForWidth()) 118 | self.ToggleBotton.setSizePolicy(sizePolicy1) 119 | self.ToggleBotton.setMinimumSize(QSize(0, 45)) 120 | self.ToggleBotton.setMaximumSize(QSize(16777215, 16777215)) 121 | font = QFont() 122 | font.setFamilies([u"Nirmala UI"]) 123 | font.setPointSize(12) 124 | font.setBold(True) 125 | font.setItalic(False) 126 | self.ToggleBotton.setFont(font) 127 | self.ToggleBotton.setCursor(QCursor(Qt.PointingHandCursor)) 128 | self.ToggleBotton.setMouseTracking(True) 129 | self.ToggleBotton.setFocusPolicy(Qt.StrongFocus) 130 | self.ToggleBotton.setContextMenuPolicy(Qt.DefaultContextMenu) 131 | self.ToggleBotton.setLayoutDirection(Qt.LeftToRight) 132 | self.ToggleBotton.setAutoFillBackground(False) 133 | self.ToggleBotton.setStyleSheet(u"QPushButton{\n" 134 | "background-image: url(:/all/img/menu.png);\n" 135 | "background-repeat: no-repeat;\n" 136 | "background-position: left center;\n" 137 | "border: none;\n" 138 | "border-left: 23px solid transparent;\n" 139 | "\n" 140 | "text-align: center;\n" 141 | "padding-left: 0px;\n" 142 | "color: rgba(255, 255, 255, 199);\n" 143 | "font: 700 12pt \"Nirmala UI\";\n" 144 | "}\n" 145 | "\n" 146 | "QPushButton:hover{\n" 147 | "background-color: rgba(114, 129, 214, 59);\n" 148 | "}") 149 | icon = QIcon() 150 | iconThemeName = u"zoom-out" 151 | if QIcon.hasThemeIcon(iconThemeName): 152 | icon = QIcon.fromTheme(iconThemeName) 153 | else: 154 | icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) 155 | 156 | self.ToggleBotton.setIcon(icon) 157 | self.ToggleBotton.setAutoDefault(False) 158 | self.ToggleBotton.setFlat(False) 159 | 160 | self.verticalLayout_4.addWidget(self.ToggleBotton) 161 | 162 | 163 | self.verticalLayout_2.addWidget(self.ToggleBox) 164 | 165 | self.MenuBox = QFrame(self.LeftMenuBg) 166 | self.MenuBox.setObjectName(u"MenuBox") 167 | self.MenuBox.setMinimumSize(QSize(200, 0)) 168 | self.MenuBox.setMaximumSize(QSize(200, 16777215)) 169 | self.MenuBox.setFrameShape(QFrame.NoFrame) 170 | self.MenuBox.setFrameShadow(QFrame.Raised) 171 | self.verticalLayout_5 = QVBoxLayout(self.MenuBox) 172 | self.verticalLayout_5.setSpacing(15) 173 | self.verticalLayout_5.setObjectName(u"verticalLayout_5") 174 | self.verticalLayout_5.setSizeConstraint(QLayout.SetDefaultConstraint) 175 | self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) 176 | self.src_file_button = QPushButton(self.MenuBox) 177 | self.src_file_button.setObjectName(u"src_file_button") 178 | self.src_file_button.setMinimumSize(QSize(0, 45)) 179 | self.src_file_button.setCursor(QCursor(Qt.PointingHandCursor)) 180 | self.src_file_button.setStyleSheet(u"QPushButton{\n" 181 | "background-image: url(:/all/img/file.png);\n" 182 | "background-repeat: no-repeat;\n" 183 | "background-position: left center;\n" 184 | "border: none;\n" 185 | "border-left: 23px solid transparent;\n" 186 | "\n" 187 | "text-align: center;\n" 188 | "padding-left: 0px;\n" 189 | "color: rgba(255, 255, 255, 199);\n" 190 | "font: 700 12pt \"Nirmala UI\";\n" 191 | "}\n" 192 | "\n" 193 | "QPushButton:hover{\n" 194 | "background-color: rgba(114, 129, 214, 59);\n" 195 | "}") 196 | 197 | self.verticalLayout_5.addWidget(self.src_file_button) 198 | 199 | self.src_cam_button = QPushButton(self.MenuBox) 200 | self.src_cam_button.setObjectName(u"src_cam_button") 201 | self.src_cam_button.setMinimumSize(QSize(0, 45)) 202 | self.src_cam_button.setCursor(QCursor(Qt.PointingHandCursor)) 203 | self.src_cam_button.setStyleSheet(u"QPushButton{\n" 204 | "background-image: url(:/all/img/cam.png);\n" 205 | "background-repeat: no-repeat;\n" 206 | "background-position: left center;\n" 207 | "border: none;\n" 208 | "border-left: 23px solid transparent;\n" 209 | "\n" 210 | "text-align: center;\n" 211 | "padding-left: 0px;\n" 212 | "color: rgba(255, 255, 255, 199);\n" 213 | "font: 700 12pt \"Nirmala UI\";\n" 214 | "}\n" 215 | "\n" 216 | "QPushButton:hover{\n" 217 | "background-color: rgba(114, 129, 214, 59);\n" 218 | "}") 219 | 220 | self.verticalLayout_5.addWidget(self.src_cam_button) 221 | 222 | self.src_rtsp_button = QPushButton(self.MenuBox) 223 | self.src_rtsp_button.setObjectName(u"src_rtsp_button") 224 | self.src_rtsp_button.setMinimumSize(QSize(0, 45)) 225 | self.src_rtsp_button.setCursor(QCursor(Qt.PointingHandCursor)) 226 | self.src_rtsp_button.setAutoFillBackground(False) 227 | self.src_rtsp_button.setStyleSheet(u"QPushButton{\n" 228 | "background-image: url(:/all/img/RTSP.png);\n" 229 | "background-repeat: no-repeat;\n" 230 | "background-position: left center;\n" 231 | "border: none;\n" 232 | "border-left: 23px solid transparent;\n" 233 | "\n" 234 | "text-align: center;\n" 235 | "padding-left: 0px;\n" 236 | "color: rgba(255, 255, 255, 199);\n" 237 | "font: 700 12pt \"Nirmala UI\";\n" 238 | "}\n" 239 | "\n" 240 | "QPushButton:hover{\n" 241 | "background-color: rgba(114, 129, 214, 59);\n" 242 | "}") 243 | 244 | self.verticalLayout_5.addWidget(self.src_rtsp_button) 245 | 246 | self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) 247 | 248 | self.verticalLayout_5.addItem(self.verticalSpacer) 249 | 250 | self.verticalLayout_5.setStretch(0, 1) 251 | 252 | self.verticalLayout_2.addWidget(self.MenuBox) 253 | 254 | self.VersionInfo = QFrame(self.LeftMenuBg) 255 | self.VersionInfo.setObjectName(u"VersionInfo") 256 | self.VersionInfo.setMinimumSize(QSize(200, 10)) 257 | self.VersionInfo.setMaximumSize(QSize(200, 15)) 258 | self.VersionInfo.setFrameShape(QFrame.StyledPanel) 259 | self.VersionInfo.setFrameShadow(QFrame.Raised) 260 | self.verticalLayout_3 = QVBoxLayout(self.VersionInfo) 261 | self.verticalLayout_3.setObjectName(u"verticalLayout_3") 262 | self.verticalLayout_3.setContentsMargins(18, 0, -1, 0) 263 | self.VersionLabel = QLabel(self.VersionInfo) 264 | self.VersionLabel.setObjectName(u"VersionLabel") 265 | self.VersionLabel.setStyleSheet(u"font: 900 italic 10pt \"Segoe UI\";\n" 266 | "color: rgba(255, 255, 255, 199);") 267 | self.VersionLabel.setAlignment(Qt.AlignCenter) 268 | 269 | self.verticalLayout_3.addWidget(self.VersionLabel) 270 | 271 | 272 | self.verticalLayout_2.addWidget(self.VersionInfo) 273 | 274 | 275 | self.main_qframe.addWidget(self.LeftMenuBg) 276 | 277 | self.ContentBox = QFrame(self.Main_QF) 278 | self.ContentBox.setObjectName(u"ContentBox") 279 | self.ContentBox.setStyleSheet(u"QFrame#ContentBox{\n" 280 | " background-color: rgb(245, 249, 254);\n" 281 | "border:0px solid red;\n" 282 | "border-radius:30px\n" 283 | "}") 284 | self.ContentBox.setFrameShape(QFrame.StyledPanel) 285 | self.ContentBox.setFrameShadow(QFrame.Raised) 286 | self.verticalLayout_6 = QVBoxLayout(self.ContentBox) 287 | self.verticalLayout_6.setSpacing(0) 288 | self.verticalLayout_6.setObjectName(u"verticalLayout_6") 289 | self.verticalLayout_6.setContentsMargins(0, 0, 0, 0) 290 | self.top = QFrame(self.ContentBox) 291 | self.top.setObjectName(u"top") 292 | self.top.setMinimumSize(QSize(0, 30)) 293 | self.top.setMaximumSize(QSize(16777215, 30)) 294 | self.top.setStyleSheet(u"QFrame#top{\n" 295 | "background-color: rgba(255, 255, 255,0);\n" 296 | "}") 297 | self.top.setFrameShape(QFrame.StyledPanel) 298 | self.top.setFrameShadow(QFrame.Raised) 299 | self.horizontalLayout = QHBoxLayout(self.top) 300 | self.horizontalLayout.setSpacing(0) 301 | self.horizontalLayout.setObjectName(u"horizontalLayout") 302 | self.horizontalLayout.setContentsMargins(20, 0, -1, 0) 303 | self.explain_title = QLabel(self.top) 304 | self.explain_title.setObjectName(u"explain_title") 305 | self.explain_title.setMinimumSize(QSize(0, 30)) 306 | self.explain_title.setMaximumSize(QSize(16777215, 30)) 307 | self.explain_title.setStyleSheet(u"font: 700 italic 11pt \"Segoe UI\";") 308 | self.explain_title.setAlignment(Qt.AlignCenter) 309 | 310 | self.horizontalLayout.addWidget(self.explain_title) 311 | 312 | self.buttons_sf = QFrame(self.top) 313 | self.buttons_sf.setObjectName(u"buttons_sf") 314 | self.buttons_sf.setMinimumSize(QSize(120, 30)) 315 | self.buttons_sf.setMaximumSize(QSize(120, 30)) 316 | self.buttons_sf.setFrameShape(QFrame.StyledPanel) 317 | self.buttons_sf.setFrameShadow(QFrame.Raised) 318 | self.horizontalLayout_2 = QHBoxLayout(self.buttons_sf) 319 | self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") 320 | self.horizontalLayout_2.setContentsMargins(-1, 0, -1, 0) 321 | self.settings_button = QPushButton(self.buttons_sf) 322 | self.settings_button.setObjectName(u"settings_button") 323 | self.settings_button.setMinimumSize(QSize(0, 20)) 324 | self.settings_button.setMaximumSize(QSize(16777215, 20)) 325 | self.settings_button.setCursor(QCursor(Qt.PointingHandCursor)) 326 | self.settings_button.setStyleSheet(u"QPushButton{\n" 327 | "background-image: url(:/all/img/set.png);\n" 328 | "background-repeat: no-repeat;\n" 329 | "background-position: center;\n" 330 | "border: none;\n" 331 | "}\n" 332 | "\n" 333 | "QPushButton:hover{\n" 334 | "\n" 335 | "}") 336 | 337 | self.horizontalLayout_2.addWidget(self.settings_button) 338 | 339 | self.min_sf = QPushButton(self.buttons_sf) 340 | self.min_sf.setObjectName(u"min_sf") 341 | self.min_sf.setMinimumSize(QSize(14, 14)) 342 | self.min_sf.setMaximumSize(QSize(14, 14)) 343 | self.min_sf.setStyleSheet(u"QPushButton{\n" 344 | " \n" 345 | " background-color: rgb(4, 180, 0);\n" 346 | "border:1px solid rgba(113, 17, 15,50);\n" 347 | "border-radius:6px;\n" 348 | "}\n" 349 | "QPushButton:hover {\n" 350 | "background-color:rgb(139, 29, 31)\n" 351 | " \n" 352 | "}\n" 353 | "QPushButton:pressed {\n" 354 | " background-color: rgb(232, 59, 35);\n" 355 | "}\n" 356 | "") 357 | 358 | self.horizontalLayout_2.addWidget(self.min_sf) 359 | 360 | self.max_sf = QPushButton(self.buttons_sf) 361 | self.max_sf.setObjectName(u"max_sf") 362 | self.max_sf.setMinimumSize(QSize(14, 14)) 363 | self.max_sf.setMaximumSize(QSize(14, 14)) 364 | self.max_sf.setStyleSheet(u"QPushButton{\n" 365 | " \n" 366 | " background-color: rgb(227, 199, 0);\n" 367 | "border:1px solid rgba(113, 17, 15,50);\n" 368 | "border-radius:6px;\n" 369 | "}\n" 370 | "QPushButton:hover {\n" 371 | "background-color:rgb(139, 29, 31)\n" 372 | " \n" 373 | "}\n" 374 | "QPushButton:pressed {\n" 375 | " background-color: rgb(232, 59, 35);\n" 376 | "}\n" 377 | "") 378 | 379 | self.horizontalLayout_2.addWidget(self.max_sf) 380 | 381 | self.close_button = QPushButton(self.buttons_sf) 382 | self.close_button.setObjectName(u"close_button") 383 | self.close_button.setMinimumSize(QSize(14, 14)) 384 | self.close_button.setMaximumSize(QSize(14, 14)) 385 | self.close_button.setStyleSheet(u"QPushButton{\n" 386 | " \n" 387 | " background-color: rgb(240, 108, 96);\n" 388 | "border:1px solid rgba(113, 17, 15,50);\n" 389 | "border-radius:6px;\n" 390 | "}\n" 391 | "QPushButton:hover {\n" 392 | "background-color:rgb(139, 29, 31)\n" 393 | " \n" 394 | "}\n" 395 | "QPushButton:pressed {\n" 396 | " background-color: rgb(232, 59, 35);\n" 397 | "}\n" 398 | "") 399 | 400 | self.horizontalLayout_2.addWidget(self.close_button) 401 | 402 | 403 | self.horizontalLayout.addWidget(self.buttons_sf) 404 | 405 | 406 | self.verticalLayout_6.addWidget(self.top) 407 | 408 | self.content = QFrame(self.ContentBox) 409 | self.content.setObjectName(u"content") 410 | self.content.setFrameShape(QFrame.StyledPanel) 411 | self.content.setFrameShadow(QFrame.Raised) 412 | self.horizontalLayout_5 = QHBoxLayout(self.content) 413 | self.horizontalLayout_5.setSpacing(0) 414 | self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") 415 | self.horizontalLayout_5.setContentsMargins(-1, 0, 0, 0) 416 | self.main_content = QVBoxLayout() 417 | self.main_content.setSpacing(5) 418 | self.main_content.setObjectName(u"main_content") 419 | self.char_label = QLabel(self.content) 420 | self.char_label.setObjectName(u"char_label") 421 | self.char_label.setMinimumSize(QSize(0, 20)) 422 | self.char_label.setMaximumSize(QSize(16777215, 20)) 423 | font1 = QFont() 424 | font1.setPointSize(16) 425 | font1.setBold(True) 426 | self.char_label.setFont(font1) 427 | self.char_label.setStyleSheet(u"padding-left:12px;") 428 | 429 | self.main_content.addWidget(self.char_label) 430 | 431 | self.QF_Group = QFrame(self.content) 432 | self.QF_Group.setObjectName(u"QF_Group") 433 | self.QF_Group.setMinimumSize(QSize(0, 100)) 434 | self.QF_Group.setMaximumSize(QSize(16777215, 100)) 435 | self.QF_Group.setStyleSheet(u"QFrame#QF_Group{\n" 436 | "background-color: rgb(238, 242, 255);\n" 437 | "border:2px solid rgb(255, 255, 255);\n" 438 | "border-radius:15px;\n" 439 | "}") 440 | self.QF_Group.setFrameShape(QFrame.StyledPanel) 441 | self.QF_Group.setFrameShadow(QFrame.Raised) 442 | self.horizontalLayout_3 = QHBoxLayout(self.QF_Group) 443 | self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") 444 | self.horizontalLayout_3.setContentsMargins(-1, 9, -1, 15) 445 | self.Class_QF = QFrame(self.QF_Group) 446 | self.Class_QF.setObjectName(u"Class_QF") 447 | self.Class_QF.setMinimumSize(QSize(170, 80)) 448 | self.Class_QF.setMaximumSize(QSize(170, 80)) 449 | self.Class_QF.setToolTipDuration(0) 450 | self.Class_QF.setStyleSheet(u"QFrame#Class_QF{\n" 451 | "color: rgb(255, 255, 255);\n" 452 | "border-radius: 15px;\n" 453 | "background-color: qradialgradient(cx:0, cy:0, radius:1, fx:0.1, fy:0.1, stop:0 rgb(162, 129, 247), stop:1 rgb(119, 111, 252));\n" 454 | "border: 1px outset rgb(98, 91, 213);\n" 455 | "}\n" 456 | "") 457 | self.Class_QF.setFrameShape(QFrame.StyledPanel) 458 | self.Class_QF.setFrameShadow(QFrame.Raised) 459 | self.verticalLayout_7 = QVBoxLayout(self.Class_QF) 460 | self.verticalLayout_7.setSpacing(0) 461 | self.verticalLayout_7.setObjectName(u"verticalLayout_7") 462 | self.verticalLayout_7.setContentsMargins(0, 0, 0, 0) 463 | self.Class_top = QFrame(self.Class_QF) 464 | self.Class_top.setObjectName(u"Class_top") 465 | self.Class_top.setStyleSheet(u"border:none") 466 | self.Class_top.setFrameShape(QFrame.StyledPanel) 467 | self.Class_top.setFrameShadow(QFrame.Raised) 468 | self.horizontalLayout_6 = QHBoxLayout(self.Class_top) 469 | self.horizontalLayout_6.setSpacing(0) 470 | self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") 471 | self.horizontalLayout_6.setContentsMargins(0, 3, 0, 3) 472 | self.label_5 = QLabel(self.Class_top) 473 | self.label_5.setObjectName(u"label_5") 474 | self.label_5.setMaximumSize(QSize(16777215, 30)) 475 | font2 = QFont() 476 | font2.setFamilies([u"Segoe UI"]) 477 | font2.setPointSize(16) 478 | font2.setBold(True) 479 | font2.setItalic(True) 480 | self.label_5.setFont(font2) 481 | self.label_5.setStyleSheet(u"color: rgba(255, 255, 255,210);\n" 482 | "padding-left:12px;\n" 483 | "font: 700 italic 16pt \"Segoe UI\";") 484 | self.label_5.setAlignment(Qt.AlignCenter) 485 | self.label_5.setIndent(0) 486 | 487 | self.horizontalLayout_6.addWidget(self.label_5) 488 | 489 | 490 | self.verticalLayout_7.addWidget(self.Class_top) 491 | 492 | self.line_2 = QFrame(self.Class_QF) 493 | self.line_2.setObjectName(u"line_2") 494 | self.line_2.setMaximumSize(QSize(16777215, 1)) 495 | self.line_2.setStyleSheet(u"background-color: rgba(255, 255, 255, 89);") 496 | self.line_2.setFrameShape(QFrame.HLine) 497 | self.line_2.setFrameShadow(QFrame.Sunken) 498 | 499 | self.verticalLayout_7.addWidget(self.line_2) 500 | 501 | self.Class_bottom = QFrame(self.Class_QF) 502 | self.Class_bottom.setObjectName(u"Class_bottom") 503 | self.Class_bottom.setStyleSheet(u"border:none") 504 | self.Class_bottom.setFrameShape(QFrame.StyledPanel) 505 | self.Class_bottom.setFrameShadow(QFrame.Raised) 506 | self.verticalLayout_8 = QVBoxLayout(self.Class_bottom) 507 | self.verticalLayout_8.setSpacing(0) 508 | self.verticalLayout_8.setObjectName(u"verticalLayout_8") 509 | self.verticalLayout_8.setContentsMargins(0, 6, 0, 6) 510 | self.Class_num = QLabel(self.Class_bottom) 511 | self.Class_num.setObjectName(u"Class_num") 512 | self.Class_num.setMinimumSize(QSize(0, 30)) 513 | self.Class_num.setMaximumSize(QSize(16777215, 30)) 514 | font3 = QFont() 515 | font3.setFamilies([u"Microsoft YaHei UI"]) 516 | font3.setPointSize(17) 517 | font3.setBold(False) 518 | font3.setItalic(False) 519 | font3.setUnderline(False) 520 | self.Class_num.setFont(font3) 521 | self.Class_num.setStyleSheet(u"color: rgb(255, 255, 255);\n" 522 | "font: 17pt \"Microsoft YaHei UI\";") 523 | self.Class_num.setAlignment(Qt.AlignCenter) 524 | 525 | self.verticalLayout_8.addWidget(self.Class_num, 0, Qt.AlignTop) 526 | 527 | 528 | self.verticalLayout_7.addWidget(self.Class_bottom) 529 | 530 | self.verticalLayout_7.setStretch(1, 2) 531 | self.verticalLayout_7.setStretch(2, 1) 532 | 533 | self.horizontalLayout_3.addWidget(self.Class_QF) 534 | 535 | self.Target_QF = QFrame(self.QF_Group) 536 | self.Target_QF.setObjectName(u"Target_QF") 537 | self.Target_QF.setMinimumSize(QSize(170, 80)) 538 | self.Target_QF.setMaximumSize(QSize(170, 80)) 539 | self.Target_QF.setToolTipDuration(0) 540 | self.Target_QF.setStyleSheet(u"QFrame#Target_QF{\n" 541 | "color: rgb(255, 255, 255);\n" 542 | "border-radius: 15px;\n" 543 | "background-color: qradialgradient(cx:0, cy:0, radius:1, fx:0.1, fy:0.1, stop:0 rgb(253, 139, 133), stop:1 rgb(248, 194, 152));\n" 544 | "border: 1px outset rgb(252, 194, 149)\n" 545 | "}\n" 546 | "") 547 | self.Target_QF.setFrameShape(QFrame.StyledPanel) 548 | self.Target_QF.setFrameShadow(QFrame.Raised) 549 | self.verticalLayout_9 = QVBoxLayout(self.Target_QF) 550 | self.verticalLayout_9.setSpacing(0) 551 | self.verticalLayout_9.setObjectName(u"verticalLayout_9") 552 | self.verticalLayout_9.setContentsMargins(0, 0, 0, 0) 553 | self.Target_top = QFrame(self.Target_QF) 554 | self.Target_top.setObjectName(u"Target_top") 555 | self.Target_top.setStyleSheet(u"border:none") 556 | self.Target_top.setFrameShape(QFrame.StyledPanel) 557 | self.Target_top.setFrameShadow(QFrame.Raised) 558 | self.horizontalLayout_7 = QHBoxLayout(self.Target_top) 559 | self.horizontalLayout_7.setSpacing(0) 560 | self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") 561 | self.horizontalLayout_7.setContentsMargins(0, 3, 0, 3) 562 | self.label_6 = QLabel(self.Target_top) 563 | self.label_6.setObjectName(u"label_6") 564 | self.label_6.setMaximumSize(QSize(16777215, 30)) 565 | self.label_6.setFont(font2) 566 | self.label_6.setStyleSheet(u"color: rgba(255, 255, 255,210);\n" 567 | "padding-left:12px;\n" 568 | "font: 700 italic 16pt \"Segoe UI\";") 569 | self.label_6.setAlignment(Qt.AlignCenter) 570 | self.label_6.setIndent(0) 571 | 572 | self.horizontalLayout_7.addWidget(self.label_6) 573 | 574 | 575 | self.verticalLayout_9.addWidget(self.Target_top) 576 | 577 | self.line_3 = QFrame(self.Target_QF) 578 | self.line_3.setObjectName(u"line_3") 579 | self.line_3.setMaximumSize(QSize(16777215, 1)) 580 | self.line_3.setStyleSheet(u"background-color: rgba(255, 255, 255, 89);") 581 | self.line_3.setFrameShape(QFrame.HLine) 582 | self.line_3.setFrameShadow(QFrame.Sunken) 583 | 584 | self.verticalLayout_9.addWidget(self.line_3) 585 | 586 | self.Target_bottom = QFrame(self.Target_QF) 587 | self.Target_bottom.setObjectName(u"Target_bottom") 588 | self.Target_bottom.setStyleSheet(u"border:none") 589 | self.Target_bottom.setFrameShape(QFrame.StyledPanel) 590 | self.Target_bottom.setFrameShadow(QFrame.Raised) 591 | self.verticalLayout_10 = QVBoxLayout(self.Target_bottom) 592 | self.verticalLayout_10.setSpacing(0) 593 | self.verticalLayout_10.setObjectName(u"verticalLayout_10") 594 | self.verticalLayout_10.setContentsMargins(0, 6, 0, 6) 595 | self.Target_num = QLabel(self.Target_bottom) 596 | self.Target_num.setObjectName(u"Target_num") 597 | self.Target_num.setMinimumSize(QSize(0, 30)) 598 | self.Target_num.setMaximumSize(QSize(16777215, 30)) 599 | self.Target_num.setFont(font3) 600 | self.Target_num.setStyleSheet(u"color: rgb(255, 255, 255);\n" 601 | "font: 17pt \"Microsoft YaHei UI\";") 602 | self.Target_num.setAlignment(Qt.AlignCenter) 603 | 604 | self.verticalLayout_10.addWidget(self.Target_num, 0, Qt.AlignTop) 605 | 606 | 607 | self.verticalLayout_9.addWidget(self.Target_bottom) 608 | 609 | self.verticalLayout_9.setStretch(1, 2) 610 | self.verticalLayout_9.setStretch(2, 1) 611 | 612 | self.horizontalLayout_3.addWidget(self.Target_QF) 613 | 614 | self.Fps_QF = QFrame(self.QF_Group) 615 | self.Fps_QF.setObjectName(u"Fps_QF") 616 | self.Fps_QF.setMinimumSize(QSize(170, 80)) 617 | self.Fps_QF.setMaximumSize(QSize(170, 80)) 618 | self.Fps_QF.setToolTipDuration(0) 619 | self.Fps_QF.setStyleSheet(u"QFrame#Fps_QF{\n" 620 | "color: rgb(255, 255, 255);\n" 621 | "border-radius: 15px;\n" 622 | "background-color: qradialgradient(cx:0, cy:0, radius:1, fx:0.1, fy:0.1, stop:0 rgb(243, 175, 189), stop:1 rgb(155, 118, 218));\n" 623 | "border: 1px outset rgb(153, 117, 219)\n" 624 | "}\n" 625 | "") 626 | self.Fps_QF.setFrameShape(QFrame.StyledPanel) 627 | self.Fps_QF.setFrameShadow(QFrame.Raised) 628 | self.verticalLayout_11 = QVBoxLayout(self.Fps_QF) 629 | self.verticalLayout_11.setSpacing(0) 630 | self.verticalLayout_11.setObjectName(u"verticalLayout_11") 631 | self.verticalLayout_11.setContentsMargins(0, 0, 0, 0) 632 | self.Fps_top = QFrame(self.Fps_QF) 633 | self.Fps_top.setObjectName(u"Fps_top") 634 | self.Fps_top.setStyleSheet(u"border:none") 635 | self.Fps_top.setFrameShape(QFrame.StyledPanel) 636 | self.Fps_top.setFrameShadow(QFrame.Raised) 637 | self.horizontalLayout_8 = QHBoxLayout(self.Fps_top) 638 | self.horizontalLayout_8.setSpacing(0) 639 | self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") 640 | self.horizontalLayout_8.setContentsMargins(0, 3, 7, 3) 641 | self.label_7 = QLabel(self.Fps_top) 642 | self.label_7.setObjectName(u"label_7") 643 | self.label_7.setMaximumSize(QSize(16777215, 30)) 644 | self.label_7.setFont(font2) 645 | self.label_7.setStyleSheet(u"color: rgba(255, 255, 255,210);\n" 646 | "padding-left:12px;\n" 647 | "font: 700 italic 16pt \"Segoe UI\";") 648 | self.label_7.setMidLineWidth(-1) 649 | self.label_7.setAlignment(Qt.AlignCenter) 650 | self.label_7.setWordWrap(False) 651 | self.label_7.setIndent(0) 652 | 653 | self.horizontalLayout_8.addWidget(self.label_7) 654 | 655 | 656 | self.verticalLayout_11.addWidget(self.Fps_top) 657 | 658 | self.line_4 = QFrame(self.Fps_QF) 659 | self.line_4.setObjectName(u"line_4") 660 | self.line_4.setMaximumSize(QSize(16777215, 1)) 661 | self.line_4.setStyleSheet(u"background-color: rgba(255, 255, 255, 89);") 662 | self.line_4.setFrameShape(QFrame.HLine) 663 | self.line_4.setFrameShadow(QFrame.Sunken) 664 | 665 | self.verticalLayout_11.addWidget(self.line_4) 666 | 667 | self.Fps_bottom = QFrame(self.Fps_QF) 668 | self.Fps_bottom.setObjectName(u"Fps_bottom") 669 | self.Fps_bottom.setStyleSheet(u"border:none") 670 | self.Fps_bottom.setFrameShape(QFrame.StyledPanel) 671 | self.Fps_bottom.setFrameShadow(QFrame.Raised) 672 | self.verticalLayout_12 = QVBoxLayout(self.Fps_bottom) 673 | self.verticalLayout_12.setSpacing(0) 674 | self.verticalLayout_12.setObjectName(u"verticalLayout_12") 675 | self.verticalLayout_12.setContentsMargins(0, 6, 0, 6) 676 | self.fps_label = QLabel(self.Fps_bottom) 677 | self.fps_label.setObjectName(u"fps_label") 678 | self.fps_label.setMinimumSize(QSize(0, 30)) 679 | self.fps_label.setMaximumSize(QSize(16777215, 30)) 680 | self.fps_label.setFont(font3) 681 | self.fps_label.setStyleSheet(u"color: rgb(255, 255, 255);\n" 682 | "font: 17pt \"Microsoft YaHei UI\";") 683 | self.fps_label.setAlignment(Qt.AlignCenter) 684 | 685 | self.verticalLayout_12.addWidget(self.fps_label, 0, Qt.AlignTop) 686 | 687 | 688 | self.verticalLayout_11.addWidget(self.Fps_bottom) 689 | 690 | self.verticalLayout_11.setStretch(1, 2) 691 | self.verticalLayout_11.setStretch(2, 1) 692 | 693 | self.horizontalLayout_3.addWidget(self.Fps_QF) 694 | 695 | self.Model_QF = QFrame(self.QF_Group) 696 | self.Model_QF.setObjectName(u"Model_QF") 697 | self.Model_QF.setMinimumSize(QSize(170, 80)) 698 | self.Model_QF.setMaximumSize(QSize(170, 80)) 699 | self.Model_QF.setToolTipDuration(0) 700 | self.Model_QF.setStyleSheet(u"QFrame#Model_QF{\n" 701 | "color: rgb(255, 255, 255);\n" 702 | "border-radius: 15px;\n" 703 | "background-color: qradialgradient(cx:0, cy:0, radius:1, fx:0.1, fy:0.1, stop:0 rgb(66, 226, 192), stop:1 rgb(62, 154, 193));\n" 704 | "border: 1px outset rgb(72, 158, 204)\n" 705 | "}\n" 706 | "") 707 | self.Model_QF.setFrameShape(QFrame.StyledPanel) 708 | self.Model_QF.setFrameShadow(QFrame.Raised) 709 | self.verticalLayout_13 = QVBoxLayout(self.Model_QF) 710 | self.verticalLayout_13.setSpacing(0) 711 | self.verticalLayout_13.setObjectName(u"verticalLayout_13") 712 | self.verticalLayout_13.setContentsMargins(0, 0, 0, 0) 713 | self.Model_top = QFrame(self.Model_QF) 714 | self.Model_top.setObjectName(u"Model_top") 715 | self.Model_top.setStyleSheet(u"border:none") 716 | self.Model_top.setFrameShape(QFrame.StyledPanel) 717 | self.Model_top.setFrameShadow(QFrame.Raised) 718 | self.horizontalLayout_9 = QHBoxLayout(self.Model_top) 719 | self.horizontalLayout_9.setSpacing(0) 720 | self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") 721 | self.horizontalLayout_9.setContentsMargins(0, 3, 7, 3) 722 | self.label_8 = QLabel(self.Model_top) 723 | self.label_8.setObjectName(u"label_8") 724 | self.label_8.setMaximumSize(QSize(16777215, 30)) 725 | self.label_8.setFont(font2) 726 | self.label_8.setStyleSheet(u"color: rgba(255, 255, 255,210);\n" 727 | "padding-left:12px;\n" 728 | "font: 700 italic 16pt \"Segoe UI\";") 729 | self.label_8.setMidLineWidth(-1) 730 | self.label_8.setAlignment(Qt.AlignCenter) 731 | self.label_8.setWordWrap(False) 732 | self.label_8.setIndent(0) 733 | 734 | self.horizontalLayout_9.addWidget(self.label_8) 735 | 736 | 737 | self.verticalLayout_13.addWidget(self.Model_top) 738 | 739 | self.line_5 = QFrame(self.Model_QF) 740 | self.line_5.setObjectName(u"line_5") 741 | self.line_5.setMaximumSize(QSize(16777215, 1)) 742 | self.line_5.setStyleSheet(u"background-color: rgba(255, 255, 255, 89);") 743 | self.line_5.setFrameShape(QFrame.HLine) 744 | self.line_5.setFrameShadow(QFrame.Sunken) 745 | 746 | self.verticalLayout_13.addWidget(self.line_5) 747 | 748 | self.Model_bottom = QFrame(self.Model_QF) 749 | self.Model_bottom.setObjectName(u"Model_bottom") 750 | self.Model_bottom.setStyleSheet(u"border:none") 751 | self.Model_bottom.setFrameShape(QFrame.StyledPanel) 752 | self.Model_bottom.setFrameShadow(QFrame.Raised) 753 | self.verticalLayout_14 = QVBoxLayout(self.Model_bottom) 754 | self.verticalLayout_14.setSpacing(0) 755 | self.verticalLayout_14.setObjectName(u"verticalLayout_14") 756 | self.verticalLayout_14.setContentsMargins(0, 6, 0, 6) 757 | self.Model_name = QLabel(self.Model_bottom) 758 | self.Model_name.setObjectName(u"Model_name") 759 | self.Model_name.setMinimumSize(QSize(0, 30)) 760 | self.Model_name.setMaximumSize(QSize(16777215, 30)) 761 | font4 = QFont() 762 | font4.setFamilies([u"Microsoft YaHei UI"]) 763 | font4.setPointSize(15) 764 | font4.setBold(False) 765 | font4.setItalic(False) 766 | font4.setUnderline(False) 767 | self.Model_name.setFont(font4) 768 | self.Model_name.setStyleSheet(u"color: rgb(255, 255, 255);\n" 769 | "font: 15pt \"Microsoft YaHei UI\";\n" 770 | "") 771 | self.Model_name.setAlignment(Qt.AlignCenter) 772 | 773 | self.verticalLayout_14.addWidget(self.Model_name, 0, Qt.AlignTop) 774 | 775 | 776 | self.verticalLayout_13.addWidget(self.Model_bottom) 777 | 778 | self.verticalLayout_13.setStretch(1, 2) 779 | self.verticalLayout_13.setStretch(2, 1) 780 | 781 | self.horizontalLayout_3.addWidget(self.Model_QF) 782 | 783 | 784 | self.main_content.addWidget(self.QF_Group) 785 | 786 | self.Result_QF = QFrame(self.content) 787 | self.Result_QF.setObjectName(u"Result_QF") 788 | self.Result_QF.setStyleSheet(u"") 789 | self.Result_QF.setFrameShape(QFrame.StyledPanel) 790 | self.Result_QF.setFrameShadow(QFrame.Raised) 791 | self.verticalLayout_16 = QVBoxLayout(self.Result_QF) 792 | self.verticalLayout_16.setSpacing(0) 793 | self.verticalLayout_16.setObjectName(u"verticalLayout_16") 794 | self.verticalLayout_16.setContentsMargins(0, 0, 0, 0) 795 | self.splitter = QSplitter(self.Result_QF) 796 | self.splitter.setObjectName(u"splitter") 797 | self.splitter.setStyleSheet(u"#splitter::handle{background: 1px solid rgba(200, 200, 200,100);}") 798 | self.splitter.setOrientation(Qt.Horizontal) 799 | self.splitter.setHandleWidth(2) 800 | self.pre_video = QLabel(self.splitter) 801 | self.pre_video.setObjectName(u"pre_video") 802 | self.pre_video.setMinimumSize(QSize(200, 100)) 803 | self.pre_video.setStyleSheet(u"background-color: rgb(238, 242, 255);\n" 804 | "border:2px solid rgb(255, 255, 255);\n" 805 | "border-radius:15px") 806 | self.pre_video.setAlignment(Qt.AlignCenter) 807 | self.splitter.addWidget(self.pre_video) 808 | self.res_video = QLabel(self.splitter) 809 | self.res_video.setObjectName(u"res_video") 810 | self.res_video.setMinimumSize(QSize(200, 100)) 811 | self.res_video.setStyleSheet(u"background-color: rgb(238, 242, 255);\n" 812 | "border:2px solid rgb(255, 255, 255);\n" 813 | "border-radius:15px") 814 | self.res_video.setAlignment(Qt.AlignCenter) 815 | self.splitter.addWidget(self.res_video) 816 | 817 | self.verticalLayout_16.addWidget(self.splitter) 818 | 819 | 820 | self.main_content.addWidget(self.Result_QF) 821 | 822 | self.Pause_QF = QFrame(self.content) 823 | self.Pause_QF.setObjectName(u"Pause_QF") 824 | self.Pause_QF.setMinimumSize(QSize(0, 30)) 825 | self.Pause_QF.setMaximumSize(QSize(16777215, 30)) 826 | self.Pause_QF.setFrameShape(QFrame.StyledPanel) 827 | self.Pause_QF.setFrameShadow(QFrame.Raised) 828 | self.horizontalLayout_4 = QHBoxLayout(self.Pause_QF) 829 | self.horizontalLayout_4.setSpacing(10) 830 | self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") 831 | self.horizontalLayout_4.setContentsMargins(0, 0, 3, 0) 832 | self.run_button = QPushButton(self.Pause_QF) 833 | self.run_button.setObjectName(u"run_button") 834 | self.run_button.setMinimumSize(QSize(0, 30)) 835 | self.run_button.setMaximumSize(QSize(16777215, 30)) 836 | self.run_button.setCursor(QCursor(Qt.PointingHandCursor)) 837 | self.run_button.setMouseTracking(True) 838 | self.run_button.setStyleSheet(u"QPushButton{\n" 839 | "background-repeat: no-repeat;\n" 840 | "background-position: center;\n" 841 | "border: none;\n" 842 | "}\n" 843 | "QPushButton:hover{\n" 844 | "\n" 845 | "}") 846 | icon1 = QIcon() 847 | icon1.addFile(u":/all/img/begin.png", QSize(), QIcon.Normal, QIcon.Off) 848 | icon1.addFile(u":/all/img/pause.png", QSize(), QIcon.Normal, QIcon.On) 849 | self.run_button.setIcon(icon1) 850 | self.run_button.setIconSize(QSize(30, 30)) 851 | self.run_button.setCheckable(True) 852 | self.run_button.setChecked(False) 853 | 854 | self.horizontalLayout_4.addWidget(self.run_button) 855 | 856 | self.progress_bar = QProgressBar(self.Pause_QF) 857 | self.progress_bar.setObjectName(u"progress_bar") 858 | self.progress_bar.setMinimumSize(QSize(0, 20)) 859 | self.progress_bar.setMaximumSize(QSize(16777215, 20)) 860 | self.progress_bar.setStyleSheet(u"QProgressBar{ \n" 861 | "font: 700 10pt \"Microsoft YaHei UI\";\n" 862 | "color: rgb(253, 143, 134); \n" 863 | "text-align:center; \n" 864 | "border:3px solid rgb(255, 255, 255);\n" 865 | "border-radius: 10px; \n" 866 | "background-color: rgba(215, 215, 215,100);\n" 867 | "} \n" 868 | "\n" 869 | "QProgressBar:chunk{ \n" 870 | "border-radius:0px; \n" 871 | "background: rgba(119, 111, 252, 200);\n" 872 | "border-radius: 7px;\n" 873 | "}") 874 | self.progress_bar.setMaximum(1000) 875 | self.progress_bar.setValue(0) 876 | 877 | self.horizontalLayout_4.addWidget(self.progress_bar) 878 | 879 | self.stop_button = QPushButton(self.Pause_QF) 880 | self.stop_button.setObjectName(u"stop_button") 881 | self.stop_button.setMinimumSize(QSize(0, 30)) 882 | self.stop_button.setMaximumSize(QSize(16777215, 30)) 883 | self.stop_button.setCursor(QCursor(Qt.PointingHandCursor)) 884 | self.stop_button.setStyleSheet(u"QPushButton{\n" 885 | "background-image: url(:/all/img/stop.png);\n" 886 | "background-repeat: no-repeat;\n" 887 | "background-position: center;\n" 888 | "border: none;\n" 889 | "}\n" 890 | "\n" 891 | "QPushButton:hover{\n" 892 | "\n" 893 | "}") 894 | 895 | self.horizontalLayout_4.addWidget(self.stop_button) 896 | 897 | 898 | self.main_content.addWidget(self.Pause_QF) 899 | 900 | 901 | self.horizontalLayout_5.addLayout(self.main_content) 902 | 903 | self.prm_page = QFrame(self.content) 904 | self.prm_page.setObjectName(u"prm_page") 905 | self.prm_page.setMinimumSize(QSize(0, 0)) 906 | self.prm_page.setMaximumSize(QSize(0, 16777215)) 907 | self.prm_page.setStyleSheet(u"QFrame#prm_page{\n" 908 | "background-color: qradialgradient(cx:0, cy:0, radius:1, fx:0.1, fy:0.1, stop:0 rgb(243, 175, 189), stop:1 rgb(155, 118, 218));\n" 909 | "border-top-left-radius:30px;\n" 910 | "border-top-right-radius:0px;\n" 911 | "border-bottom-right-radius:0px;\n" 912 | "border-bottom-left-radius:30px;\n" 913 | "}") 914 | self.prm_page.setFrameShape(QFrame.StyledPanel) 915 | self.prm_page.setFrameShadow(QFrame.Raised) 916 | self.verticalLayout_22 = QVBoxLayout(self.prm_page) 917 | self.verticalLayout_22.setSpacing(15) 918 | self.verticalLayout_22.setObjectName(u"verticalLayout_22") 919 | self.verticalLayout_22.setContentsMargins(15, 15, -1, -1) 920 | self.label = QLabel(self.prm_page) 921 | self.label.setObjectName(u"label") 922 | self.label.setStyleSheet(u"padding-left: 0px;\n" 923 | "padding-bottom: 2px;\n" 924 | "color: rgba(255, 255, 255, 240);\n" 925 | "font: 700 italic 16pt \"Segoe UI\";") 926 | self.label.setAlignment(Qt.AlignCenter) 927 | 928 | self.verticalLayout_22.addWidget(self.label) 929 | 930 | self.Model_QF_2 = QWidget(self.prm_page) 931 | self.Model_QF_2.setObjectName(u"Model_QF_2") 932 | self.Model_QF_2.setMinimumSize(QSize(190, 90)) 933 | self.Model_QF_2.setMaximumSize(QSize(190, 90)) 934 | self.Model_QF_2.setStyleSheet(u"QWidget#Model_QF_2{\n" 935 | "border:2px solid rgba(255, 255, 255, 70);\n" 936 | "border-radius:15px;\n" 937 | "}") 938 | self.verticalLayout_21 = QVBoxLayout(self.Model_QF_2) 939 | self.verticalLayout_21.setObjectName(u"verticalLayout_21") 940 | self.verticalLayout_21.setContentsMargins(9, 9, 9, 9) 941 | self.ToggleBotton_6 = QPushButton(self.Model_QF_2) 942 | self.ToggleBotton_6.setObjectName(u"ToggleBotton_6") 943 | sizePolicy1.setHeightForWidth(self.ToggleBotton_6.sizePolicy().hasHeightForWidth()) 944 | self.ToggleBotton_6.setSizePolicy(sizePolicy1) 945 | self.ToggleBotton_6.setMinimumSize(QSize(0, 30)) 946 | self.ToggleBotton_6.setMaximumSize(QSize(16777215, 30)) 947 | font5 = QFont() 948 | font5.setFamilies([u"Nirmala UI"]) 949 | font5.setPointSize(13) 950 | font5.setBold(True) 951 | font5.setItalic(False) 952 | self.ToggleBotton_6.setFont(font5) 953 | self.ToggleBotton_6.setCursor(QCursor(Qt.ArrowCursor)) 954 | self.ToggleBotton_6.setMouseTracking(True) 955 | self.ToggleBotton_6.setFocusPolicy(Qt.StrongFocus) 956 | self.ToggleBotton_6.setContextMenuPolicy(Qt.DefaultContextMenu) 957 | self.ToggleBotton_6.setLayoutDirection(Qt.LeftToRight) 958 | self.ToggleBotton_6.setAutoFillBackground(False) 959 | self.ToggleBotton_6.setStyleSheet(u"QPushButton{\n" 960 | "background-image: url(:/all/img/model.png);\n" 961 | "background-repeat: no-repeat;\n" 962 | "background-position: left center;\n" 963 | "border: none;\n" 964 | "border-left: 20px solid transparent;\n" 965 | "\n" 966 | "text-align: left;\n" 967 | "padding-left: 40px;\n" 968 | "padding-bottom: 2px;\n" 969 | "color: rgba(255, 255, 255, 199);\n" 970 | "font: 700 13pt \"Nirmala UI\";\n" 971 | "}") 972 | self.ToggleBotton_6.setIcon(icon) 973 | self.ToggleBotton_6.setAutoDefault(False) 974 | self.ToggleBotton_6.setFlat(False) 975 | 976 | self.verticalLayout_21.addWidget(self.ToggleBotton_6) 977 | 978 | self.model_box = QComboBox(self.Model_QF_2) 979 | self.model_box.setObjectName(u"model_box") 980 | self.model_box.setMinimumSize(QSize(170, 20)) 981 | self.model_box.setMaximumSize(QSize(170, 20)) 982 | self.model_box.setStyleSheet(u"\n" 983 | "QComboBox {\n" 984 | " background-color: rgba(255,255,255,90);\n" 985 | " color: rgba(0, 0, 0, 200);\n" 986 | " font: 600 9pt \"Segoe UI\";\n" 987 | " border: 1px solid lightgray;\n" 988 | " border-radius: 10px;\n" 989 | " padding-left: 15px;\n" 990 | " }\n" 991 | " \n" 992 | " QComboBox:on {\n" 993 | " border: 1px solid #63acfb;\n" 994 | " }\n" 995 | "\n" 996 | " QComboBox::drop-down {\n" 997 | " width: 22px;\n" 998 | " border-left: 1px solid lightgray;\n" 999 | " border-top-right-radius: 15px;\n" 1000 | " border-bottom-right-radius: 15px;\n" 1001 | " }\n" 1002 | " \n" 1003 | " QComboBox::drop-down:on {\n" 1004 | " border-left: 1px solid #63acfb;\n" 1005 | " }\n" 1006 | "\n" 1007 | " QComboBox::down-arrow {\n" 1008 | " width: 16px;\n" 1009 | " height: 16px;\n" 1010 | " image: url(:/all/img/box_down.png);\n" 1011 | " }\n" 1012 | "\n" 1013 | " QComboBox::down-arrow:on {\n" 1014 | " image: url(:/all/img/box_up.png);\n" 1015 | " }\n" 1016 | "\n" 1017 | " QComboBox QAbstractI" 1018 | "temView {\n" 1019 | " border: none;\n" 1020 | " outline: none;\n" 1021 | " padding: 10px;\n" 1022 | " background-color: rgb(223, 188, 220);\n" 1023 | " }\n" 1024 | "\n" 1025 | "\n" 1026 | " QComboBox QScrollBar:vertical {\n" 1027 | " width: 2px;\n" 1028 | " background-color: rgba(255,255,255,150);\n" 1029 | " }\n" 1030 | "\n" 1031 | " QComboBox QScrollBar::handle:vertical {\n" 1032 | " background-color: rgba(255,255,255,90);\n" 1033 | " }") 1034 | self.model_box.setInsertPolicy(QComboBox.NoInsert) 1035 | self.model_box.setMinimumContentsLength(0) 1036 | 1037 | self.verticalLayout_21.addWidget(self.model_box) 1038 | 1039 | 1040 | self.verticalLayout_22.addWidget(self.Model_QF_2) 1041 | 1042 | self.IOU_QF = QFrame(self.prm_page) 1043 | self.IOU_QF.setObjectName(u"IOU_QF") 1044 | self.IOU_QF.setMinimumSize(QSize(190, 90)) 1045 | self.IOU_QF.setMaximumSize(QSize(190, 90)) 1046 | self.IOU_QF.setStyleSheet(u"QFrame#IOU_QF{\n" 1047 | "border:2px solid rgba(255, 255, 255, 70);\n" 1048 | "border-radius:15px;\n" 1049 | "}") 1050 | self.verticalLayout_15 = QVBoxLayout(self.IOU_QF) 1051 | self.verticalLayout_15.setObjectName(u"verticalLayout_15") 1052 | self.ToggleBotton_2 = QPushButton(self.IOU_QF) 1053 | self.ToggleBotton_2.setObjectName(u"ToggleBotton_2") 1054 | sizePolicy1.setHeightForWidth(self.ToggleBotton_2.sizePolicy().hasHeightForWidth()) 1055 | self.ToggleBotton_2.setSizePolicy(sizePolicy1) 1056 | self.ToggleBotton_2.setMinimumSize(QSize(0, 30)) 1057 | self.ToggleBotton_2.setMaximumSize(QSize(16777215, 30)) 1058 | self.ToggleBotton_2.setFont(font5) 1059 | self.ToggleBotton_2.setCursor(QCursor(Qt.ArrowCursor)) 1060 | self.ToggleBotton_2.setMouseTracking(True) 1061 | self.ToggleBotton_2.setFocusPolicy(Qt.StrongFocus) 1062 | self.ToggleBotton_2.setContextMenuPolicy(Qt.DefaultContextMenu) 1063 | self.ToggleBotton_2.setLayoutDirection(Qt.LeftToRight) 1064 | self.ToggleBotton_2.setAutoFillBackground(False) 1065 | self.ToggleBotton_2.setStyleSheet(u"QPushButton{\n" 1066 | "background-image: url(:/all/img/IOU.png);\n" 1067 | "background-repeat: no-repeat;\n" 1068 | "background-position: left center;\n" 1069 | "border: none;\n" 1070 | "border-left: 20px solid transparent;\n" 1071 | "\n" 1072 | "text-align: left;\n" 1073 | "padding-left: 40px;\n" 1074 | "padding-bottom: 4px;\n" 1075 | "color: rgba(255, 255, 255, 199);\n" 1076 | "font: 700 13pt \"Nirmala UI\";\n" 1077 | "}") 1078 | self.ToggleBotton_2.setIcon(icon) 1079 | self.ToggleBotton_2.setAutoDefault(False) 1080 | self.ToggleBotton_2.setFlat(False) 1081 | 1082 | self.verticalLayout_15.addWidget(self.ToggleBotton_2) 1083 | 1084 | self.frame = QFrame(self.IOU_QF) 1085 | self.frame.setObjectName(u"frame") 1086 | sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth()) 1087 | self.frame.setSizePolicy(sizePolicy) 1088 | self.frame.setMinimumSize(QSize(0, 20)) 1089 | self.frame.setMaximumSize(QSize(16777215, 20)) 1090 | self.horizontalLayout_10 = QHBoxLayout(self.frame) 1091 | self.horizontalLayout_10.setSpacing(10) 1092 | self.horizontalLayout_10.setObjectName(u"horizontalLayout_10") 1093 | self.horizontalLayout_10.setContentsMargins(8, 0, 10, 0) 1094 | self.iou_spinbox = QDoubleSpinBox(self.frame) 1095 | self.iou_spinbox.setObjectName(u"iou_spinbox") 1096 | self.iou_spinbox.setCursor(QCursor(Qt.PointingHandCursor)) 1097 | self.iou_spinbox.setStyleSheet(u"QDoubleSpinBox {\n" 1098 | "border: 0px solid lightgray;\n" 1099 | "border-radius: 2px;\n" 1100 | "background-color: rgba(255,255,255,90);\n" 1101 | "font: 600 9pt \"Segoe UI\";\n" 1102 | "}\n" 1103 | " \n" 1104 | "QDoubleSpinBox::up-button {\n" 1105 | "width: 10px;\n" 1106 | "height: 9px;\n" 1107 | "margin: 0px 3px 0px 0px;\n" 1108 | "border-image: url(:/all/img/box_up.png);\n" 1109 | "}\n" 1110 | "QDoubleSpinBox::up-button:pressed {\n" 1111 | "margin-top: 1px;\n" 1112 | "}\n" 1113 | " \n" 1114 | "QDoubleSpinBox::down-button {\n" 1115 | "width: 10px;\n" 1116 | "height: 9px;\n" 1117 | "margin: 0px 3px 0px 0px;\n" 1118 | "border-image: url(:/all/img/box_down.png);\n" 1119 | "}\n" 1120 | "QDoubleSpinBox::down-button:pressed {\n" 1121 | "margin-bottom: 1px;\n" 1122 | "}") 1123 | self.iou_spinbox.setMinimum(0.010000000000000) 1124 | self.iou_spinbox.setMaximum(1.000000000000000) 1125 | self.iou_spinbox.setSingleStep(0.050000000000000) 1126 | self.iou_spinbox.setValue(0.450000000000000) 1127 | 1128 | self.horizontalLayout_10.addWidget(self.iou_spinbox) 1129 | 1130 | self.iou_slider = QSlider(self.frame) 1131 | self.iou_slider.setObjectName(u"iou_slider") 1132 | self.iou_slider.setCursor(QCursor(Qt.PointingHandCursor)) 1133 | self.iou_slider.setStyleSheet(u"QSlider::groove:horizontal {\n" 1134 | "border: none;\n" 1135 | "height: 10px;\n" 1136 | "background-color: rgba(255,255,255,90);\n" 1137 | "border-radius: 5px;\n" 1138 | "}\n" 1139 | "\n" 1140 | "QSlider::handle:horizontal {\n" 1141 | "width: 10px;\n" 1142 | "margin: -1px 0px -1px 0px;\n" 1143 | "border-radius: 3px;\n" 1144 | "background-color: white;\n" 1145 | "}\n" 1146 | "\n" 1147 | "QSlider::sub-page:horizontal {\n" 1148 | "background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #59969b, stop:1 #04e7fa);\n" 1149 | "border-radius: 5px;\n" 1150 | "}") 1151 | self.iou_slider.setMinimum(1) 1152 | self.iou_slider.setMaximum(100) 1153 | self.iou_slider.setValue(45) 1154 | self.iou_slider.setOrientation(Qt.Horizontal) 1155 | 1156 | self.horizontalLayout_10.addWidget(self.iou_slider) 1157 | 1158 | 1159 | self.verticalLayout_15.addWidget(self.frame) 1160 | 1161 | 1162 | self.verticalLayout_22.addWidget(self.IOU_QF) 1163 | 1164 | self.Conf_QF = QFrame(self.prm_page) 1165 | self.Conf_QF.setObjectName(u"Conf_QF") 1166 | self.Conf_QF.setMinimumSize(QSize(190, 90)) 1167 | self.Conf_QF.setMaximumSize(QSize(190, 90)) 1168 | self.Conf_QF.setStyleSheet(u"QFrame#Conf_QF{\n" 1169 | "border:2px solid rgba(255, 255, 255, 70);\n" 1170 | "border-radius:15px;\n" 1171 | "}") 1172 | self.verticalLayout_18 = QVBoxLayout(self.Conf_QF) 1173 | self.verticalLayout_18.setObjectName(u"verticalLayout_18") 1174 | self.ToggleBotton_3 = QPushButton(self.Conf_QF) 1175 | self.ToggleBotton_3.setObjectName(u"ToggleBotton_3") 1176 | sizePolicy1.setHeightForWidth(self.ToggleBotton_3.sizePolicy().hasHeightForWidth()) 1177 | self.ToggleBotton_3.setSizePolicy(sizePolicy1) 1178 | self.ToggleBotton_3.setMinimumSize(QSize(0, 30)) 1179 | self.ToggleBotton_3.setMaximumSize(QSize(16777215, 30)) 1180 | self.ToggleBotton_3.setFont(font5) 1181 | self.ToggleBotton_3.setCursor(QCursor(Qt.ArrowCursor)) 1182 | self.ToggleBotton_3.setMouseTracking(True) 1183 | self.ToggleBotton_3.setFocusPolicy(Qt.StrongFocus) 1184 | self.ToggleBotton_3.setContextMenuPolicy(Qt.DefaultContextMenu) 1185 | self.ToggleBotton_3.setLayoutDirection(Qt.LeftToRight) 1186 | self.ToggleBotton_3.setAutoFillBackground(False) 1187 | self.ToggleBotton_3.setStyleSheet(u"QPushButton{\n" 1188 | "background-image: url(:/all/img/conf.png);\n" 1189 | "background-repeat: no-repeat;\n" 1190 | "background-position: left center;\n" 1191 | "border: none;\n" 1192 | "border-left: 20px solid transparent;\n" 1193 | "\n" 1194 | "text-align: left;\n" 1195 | "padding-left: 40px;\n" 1196 | "padding-bottom: 4px;\n" 1197 | "color: rgba(255, 255, 255, 199);\n" 1198 | "font: 700 13pt \"Nirmala UI\";\n" 1199 | "}") 1200 | self.ToggleBotton_3.setIcon(icon) 1201 | self.ToggleBotton_3.setAutoDefault(False) 1202 | self.ToggleBotton_3.setFlat(False) 1203 | 1204 | self.verticalLayout_18.addWidget(self.ToggleBotton_3) 1205 | 1206 | self.frame1 = QFrame(self.Conf_QF) 1207 | self.frame1.setObjectName(u"frame1") 1208 | sizePolicy.setHeightForWidth(self.frame1.sizePolicy().hasHeightForWidth()) 1209 | self.frame1.setSizePolicy(sizePolicy) 1210 | self.frame1.setMinimumSize(QSize(0, 20)) 1211 | self.frame1.setMaximumSize(QSize(16777215, 20)) 1212 | self.horizontalLayout_11 = QHBoxLayout(self.frame1) 1213 | self.horizontalLayout_11.setSpacing(10) 1214 | self.horizontalLayout_11.setObjectName(u"horizontalLayout_11") 1215 | self.horizontalLayout_11.setContentsMargins(8, 0, 10, 0) 1216 | self.conf_spinbox = QDoubleSpinBox(self.frame1) 1217 | self.conf_spinbox.setObjectName(u"conf_spinbox") 1218 | self.conf_spinbox.setCursor(QCursor(Qt.PointingHandCursor)) 1219 | self.conf_spinbox.setStyleSheet(u"QDoubleSpinBox {\n" 1220 | "border: 0px solid lightgray;\n" 1221 | "border-radius: 2px;\n" 1222 | "background-color: rgba(255,255,255,90);\n" 1223 | "font: 600 9pt \"Segoe UI\";\n" 1224 | "}\n" 1225 | " \n" 1226 | "QDoubleSpinBox::up-button {\n" 1227 | "width: 10px;\n" 1228 | "height: 9px;\n" 1229 | "margin: 0px 3px 0px 0px;\n" 1230 | "border-image: url(:/all/img/box_up.png);\n" 1231 | "}\n" 1232 | "QDoubleSpinBox::up-button:pressed {\n" 1233 | "margin-top: 1px;\n" 1234 | "}\n" 1235 | " \n" 1236 | "QDoubleSpinBox::down-button {\n" 1237 | "width: 10px;\n" 1238 | "height: 9px;\n" 1239 | "margin: 0px 3px 0px 0px;\n" 1240 | "border-image: url(:/all/img/box_down.png);\n" 1241 | "}\n" 1242 | "QDoubleSpinBox::down-button:pressed {\n" 1243 | "margin-bottom: 1px;\n" 1244 | "}") 1245 | self.conf_spinbox.setMinimum(0.010000000000000) 1246 | self.conf_spinbox.setMaximum(1.000000000000000) 1247 | self.conf_spinbox.setSingleStep(0.050000000000000) 1248 | self.conf_spinbox.setValue(0.250000000000000) 1249 | 1250 | self.horizontalLayout_11.addWidget(self.conf_spinbox) 1251 | 1252 | self.conf_slider = QSlider(self.frame1) 1253 | self.conf_slider.setObjectName(u"conf_slider") 1254 | self.conf_slider.setCursor(QCursor(Qt.PointingHandCursor)) 1255 | self.conf_slider.setStyleSheet(u"QSlider::groove:horizontal {\n" 1256 | "border: none;\n" 1257 | "height: 10px;\n" 1258 | "background-color: rgba(255,255,255,90);\n" 1259 | "border-radius: 5px;\n" 1260 | "}\n" 1261 | "\n" 1262 | "QSlider::handle:horizontal {\n" 1263 | "width: 10px;\n" 1264 | "margin: -1px 0px -1px 0px;\n" 1265 | "border-radius: 3px;\n" 1266 | "background-color: white;\n" 1267 | "}\n" 1268 | "\n" 1269 | "QSlider::sub-page:horizontal {\n" 1270 | "background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #59969b, stop:1 #04e7fa);\n" 1271 | "border-radius: 5px;\n" 1272 | "}") 1273 | self.conf_slider.setMinimum(1) 1274 | self.conf_slider.setMaximum(100) 1275 | self.conf_slider.setValue(25) 1276 | self.conf_slider.setOrientation(Qt.Horizontal) 1277 | 1278 | self.horizontalLayout_11.addWidget(self.conf_slider) 1279 | 1280 | 1281 | self.verticalLayout_18.addWidget(self.frame1) 1282 | 1283 | 1284 | self.verticalLayout_22.addWidget(self.Conf_QF) 1285 | 1286 | self.Delay_QF = QFrame(self.prm_page) 1287 | self.Delay_QF.setObjectName(u"Delay_QF") 1288 | self.Delay_QF.setMinimumSize(QSize(190, 90)) 1289 | self.Delay_QF.setMaximumSize(QSize(190, 90)) 1290 | self.Delay_QF.setStyleSheet(u"QFrame#Delay_QF{\n" 1291 | "border:2px solid rgba(255, 255, 255, 70);\n" 1292 | "border-radius:15px;\n" 1293 | "}") 1294 | self.verticalLayout_19 = QVBoxLayout(self.Delay_QF) 1295 | self.verticalLayout_19.setObjectName(u"verticalLayout_19") 1296 | self.ToggleBotton_4 = QPushButton(self.Delay_QF) 1297 | self.ToggleBotton_4.setObjectName(u"ToggleBotton_4") 1298 | sizePolicy1.setHeightForWidth(self.ToggleBotton_4.sizePolicy().hasHeightForWidth()) 1299 | self.ToggleBotton_4.setSizePolicy(sizePolicy1) 1300 | self.ToggleBotton_4.setMinimumSize(QSize(0, 30)) 1301 | self.ToggleBotton_4.setMaximumSize(QSize(16777215, 30)) 1302 | self.ToggleBotton_4.setFont(font5) 1303 | self.ToggleBotton_4.setCursor(QCursor(Qt.ArrowCursor)) 1304 | self.ToggleBotton_4.setMouseTracking(True) 1305 | self.ToggleBotton_4.setFocusPolicy(Qt.StrongFocus) 1306 | self.ToggleBotton_4.setContextMenuPolicy(Qt.DefaultContextMenu) 1307 | self.ToggleBotton_4.setLayoutDirection(Qt.LeftToRight) 1308 | self.ToggleBotton_4.setAutoFillBackground(False) 1309 | self.ToggleBotton_4.setStyleSheet(u"QPushButton{\n" 1310 | "background-image: url(:/all/img/delay.png);\n" 1311 | "background-repeat: no-repeat;\n" 1312 | "background-position: left center;\n" 1313 | "border: none;\n" 1314 | "border-left: 20px solid transparent;\n" 1315 | "\n" 1316 | "text-align: left;\n" 1317 | "padding-left: 40px;\n" 1318 | "padding-bottom: 2px;\n" 1319 | "color: rgba(255, 255, 255, 199);\n" 1320 | "font: 700 13pt \"Nirmala UI\";\n" 1321 | "}") 1322 | self.ToggleBotton_4.setIcon(icon) 1323 | self.ToggleBotton_4.setAutoDefault(False) 1324 | self.ToggleBotton_4.setFlat(False) 1325 | 1326 | self.verticalLayout_19.addWidget(self.ToggleBotton_4) 1327 | 1328 | self.frame_2 = QFrame(self.Delay_QF) 1329 | self.frame_2.setObjectName(u"frame_2") 1330 | sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth()) 1331 | self.frame_2.setSizePolicy(sizePolicy) 1332 | self.frame_2.setMinimumSize(QSize(0, 20)) 1333 | self.frame_2.setMaximumSize(QSize(16777215, 20)) 1334 | self.horizontalLayout_12 = QHBoxLayout(self.frame_2) 1335 | self.horizontalLayout_12.setSpacing(10) 1336 | self.horizontalLayout_12.setObjectName(u"horizontalLayout_12") 1337 | self.horizontalLayout_12.setContentsMargins(8, 0, 10, 0) 1338 | self.speed_spinbox = QSpinBox(self.frame_2) 1339 | self.speed_spinbox.setObjectName(u"speed_spinbox") 1340 | self.speed_spinbox.setStyleSheet(u"QSpinBox {\n" 1341 | "border: 0px solid lightgray;\n" 1342 | "border-radius: 2px;\n" 1343 | "background-color: rgba(255,255,255,90);\n" 1344 | "font: 600 9pt \"Segoe UI\";\n" 1345 | "}\n" 1346 | " \n" 1347 | "QSpinBox::up-button {\n" 1348 | "width: 10px;\n" 1349 | "height: 9px;\n" 1350 | "margin: 0px 3px 0px 0px;\n" 1351 | "border-image: url(:/all/img/box_up.png);\n" 1352 | "}\n" 1353 | "QSpinBox::up-button:pressed {\n" 1354 | "margin-top: 1px;\n" 1355 | "}\n" 1356 | " \n" 1357 | "QSpinBox::down-button {\n" 1358 | "width: 10px;\n" 1359 | "height: 9px;\n" 1360 | "margin: 0px 3px 0px 0px;\n" 1361 | "border-image: url(:/all/img/box_down.png);\n" 1362 | "}\n" 1363 | "QSpinBox::down-button:pressed {\n" 1364 | "margin-bottom: 1px;\n" 1365 | "}") 1366 | self.speed_spinbox.setMaximum(50) 1367 | self.speed_spinbox.setValue(10) 1368 | 1369 | self.horizontalLayout_12.addWidget(self.speed_spinbox) 1370 | 1371 | self.speed_slider = QSlider(self.frame_2) 1372 | self.speed_slider.setObjectName(u"speed_slider") 1373 | self.speed_slider.setCursor(QCursor(Qt.PointingHandCursor)) 1374 | self.speed_slider.setStyleSheet(u"QSlider::groove:horizontal {\n" 1375 | "border: none;\n" 1376 | "height: 10px;\n" 1377 | "background-color: rgba(255,255,255,90);\n" 1378 | "border-radius: 5px;\n" 1379 | "}\n" 1380 | "\n" 1381 | "QSlider::handle:horizontal {\n" 1382 | "width: 10px;\n" 1383 | "margin: -1px 0px -1px 0px;\n" 1384 | "border-radius: 3px;\n" 1385 | "background-color: white;\n" 1386 | "}\n" 1387 | "\n" 1388 | "QSlider::sub-page:horizontal {\n" 1389 | "background-color: qradialgradient(cx:0, cy:0, radius:1, fx:0.1, fy:0.1, stop:0 rgb(253, 139, 133), stop:1 rgb(248, 194, 152));\n" 1390 | "border-radius: 5px;\n" 1391 | "}") 1392 | self.speed_slider.setMaximum(50) 1393 | self.speed_slider.setValue(10) 1394 | self.speed_slider.setOrientation(Qt.Horizontal) 1395 | 1396 | self.horizontalLayout_12.addWidget(self.speed_slider) 1397 | 1398 | 1399 | self.verticalLayout_19.addWidget(self.frame_2) 1400 | 1401 | 1402 | self.verticalLayout_22.addWidget(self.Delay_QF) 1403 | 1404 | self.Save_QF = QFrame(self.prm_page) 1405 | self.Save_QF.setObjectName(u"Save_QF") 1406 | self.Save_QF.setMinimumSize(QSize(190, 120)) 1407 | self.Save_QF.setMaximumSize(QSize(190, 120)) 1408 | self.Save_QF.setStyleSheet(u"QFrame#Save_QF{\n" 1409 | "border:2px solid rgba(255, 255, 255, 70);\n" 1410 | "border-radius:15px;\n" 1411 | "}") 1412 | self.verticalLayout_20 = QVBoxLayout(self.Save_QF) 1413 | self.verticalLayout_20.setObjectName(u"verticalLayout_20") 1414 | self.verticalLayout_20.setContentsMargins(9, 9, 9, 9) 1415 | self.ToggleBotton_5 = QPushButton(self.Save_QF) 1416 | self.ToggleBotton_5.setObjectName(u"ToggleBotton_5") 1417 | sizePolicy1.setHeightForWidth(self.ToggleBotton_5.sizePolicy().hasHeightForWidth()) 1418 | self.ToggleBotton_5.setSizePolicy(sizePolicy1) 1419 | self.ToggleBotton_5.setMinimumSize(QSize(0, 30)) 1420 | self.ToggleBotton_5.setMaximumSize(QSize(16777215, 30)) 1421 | self.ToggleBotton_5.setFont(font5) 1422 | self.ToggleBotton_5.setCursor(QCursor(Qt.ArrowCursor)) 1423 | self.ToggleBotton_5.setMouseTracking(True) 1424 | self.ToggleBotton_5.setFocusPolicy(Qt.StrongFocus) 1425 | self.ToggleBotton_5.setContextMenuPolicy(Qt.DefaultContextMenu) 1426 | self.ToggleBotton_5.setLayoutDirection(Qt.LeftToRight) 1427 | self.ToggleBotton_5.setAutoFillBackground(False) 1428 | self.ToggleBotton_5.setStyleSheet(u"QPushButton{\n" 1429 | "background-image: url(:/all/img/save.png);\n" 1430 | "background-repeat: no-repeat;\n" 1431 | "background-position: left center;\n" 1432 | "border: none;\n" 1433 | "border-left: 20px solid transparent;\n" 1434 | "\n" 1435 | "text-align: left;\n" 1436 | "padding-left: 40px;\n" 1437 | "padding-bottom: 2px;\n" 1438 | "color: rgba(255, 255, 255, 199);\n" 1439 | "font: 700 13pt \"Nirmala UI\";\n" 1440 | "}") 1441 | self.ToggleBotton_5.setIcon(icon) 1442 | self.ToggleBotton_5.setAutoDefault(False) 1443 | self.ToggleBotton_5.setFlat(False) 1444 | 1445 | self.verticalLayout_20.addWidget(self.ToggleBotton_5) 1446 | 1447 | self.save_res_button = QCheckBox(self.Save_QF) 1448 | self.save_res_button.setObjectName(u"save_res_button") 1449 | self.save_res_button.setCursor(QCursor(Qt.PointingHandCursor)) 1450 | self.save_res_button.setStyleSheet(u"QCheckBox {\n" 1451 | "color: rgba(255, 255, 255, 199);\n" 1452 | "font: 590 10pt \"Nirmala UI\";\n" 1453 | " }\n" 1454 | "\n" 1455 | " QCheckBox::indicator {\n" 1456 | " padding-top: 1px;\n" 1457 | "padding-left: 10px;\n" 1458 | " width: 40px;\n" 1459 | " height: 30px;\n" 1460 | " border: none;\n" 1461 | " }\n" 1462 | "\n" 1463 | " QCheckBox::indicator:unchecked {\n" 1464 | " image: url(:/all/img/check_no.png);\n" 1465 | " }\n" 1466 | "\n" 1467 | " QCheckBox::indicator:checked {\n" 1468 | " image: url(:/all/img/check_yes.png);\n" 1469 | " }") 1470 | 1471 | self.verticalLayout_20.addWidget(self.save_res_button) 1472 | 1473 | self.save_txt_button = QCheckBox(self.Save_QF) 1474 | self.save_txt_button.setObjectName(u"save_txt_button") 1475 | self.save_txt_button.setCursor(QCursor(Qt.PointingHandCursor)) 1476 | self.save_txt_button.setStyleSheet(u"QCheckBox {\n" 1477 | "color: rgba(255, 255, 255, 199);\n" 1478 | "font: 590 10pt \"Nirmala UI\";\n" 1479 | " }\n" 1480 | "\n" 1481 | " QCheckBox::indicator {\n" 1482 | " padding-top: 1px;\n" 1483 | "padding-left: 10px;\n" 1484 | " width: 40px;\n" 1485 | " height: 30px;\n" 1486 | " border: none;\n" 1487 | " }\n" 1488 | "\n" 1489 | " QCheckBox::indicator:unchecked {\n" 1490 | " image: url(:/all/img/check_no.png);\n" 1491 | " }\n" 1492 | "\n" 1493 | " QCheckBox::indicator:checked {\n" 1494 | " image: url(:/all/img/check_yes.png);\n" 1495 | " }") 1496 | 1497 | self.verticalLayout_20.addWidget(self.save_txt_button) 1498 | 1499 | 1500 | self.verticalLayout_22.addWidget(self.Save_QF) 1501 | 1502 | self.verticalSpacer_2 = QSpacerItem(20, 13, QSizePolicy.Minimum, QSizePolicy.Expanding) 1503 | 1504 | self.verticalLayout_22.addItem(self.verticalSpacer_2) 1505 | 1506 | 1507 | self.horizontalLayout_5.addWidget(self.prm_page) 1508 | 1509 | 1510 | self.verticalLayout_6.addWidget(self.content) 1511 | 1512 | self.below = QFrame(self.ContentBox) 1513 | self.below.setObjectName(u"below") 1514 | self.below.setMinimumSize(QSize(0, 30)) 1515 | self.below.setMaximumSize(QSize(16777215, 30)) 1516 | self.below.setFrameShape(QFrame.StyledPanel) 1517 | self.below.setFrameShadow(QFrame.Raised) 1518 | self.horizontalLayout_13 = QHBoxLayout(self.below) 1519 | self.horizontalLayout_13.setObjectName(u"horizontalLayout_13") 1520 | self.horizontalLayout_13.setContentsMargins(20, 2, 0, 4) 1521 | self.status_bar = QLabel(self.below) 1522 | self.status_bar.setObjectName(u"status_bar") 1523 | self.status_bar.setStyleSheet(u"font: 700 11pt \"Segoe UI\";\n" 1524 | "color: rgba(0, 0, 0, 140);") 1525 | 1526 | self.horizontalLayout_13.addWidget(self.status_bar) 1527 | 1528 | self.frame_size_grip = QFrame(self.below) 1529 | self.frame_size_grip.setObjectName(u"frame_size_grip") 1530 | self.frame_size_grip.setMaximumSize(QSize(20, 16777215)) 1531 | self.frame_size_grip.setStyleSheet(u"border-radius:30px;") 1532 | self.frame_size_grip.setFrameShape(QFrame.StyledPanel) 1533 | self.frame_size_grip.setFrameShadow(QFrame.Raised) 1534 | 1535 | self.horizontalLayout_13.addWidget(self.frame_size_grip) 1536 | 1537 | 1538 | self.verticalLayout_6.addWidget(self.below) 1539 | 1540 | 1541 | self.main_qframe.addWidget(self.ContentBox) 1542 | 1543 | 1544 | self.verticalLayout.addWidget(self.Main_QF) 1545 | 1546 | MainWindow.setCentralWidget(self.Main_QW) 1547 | 1548 | self.retranslateUi(MainWindow) 1549 | 1550 | self.ToggleBotton.setDefault(False) 1551 | self.ToggleBotton_6.setDefault(False) 1552 | self.ToggleBotton_2.setDefault(False) 1553 | self.ToggleBotton_3.setDefault(False) 1554 | self.ToggleBotton_4.setDefault(False) 1555 | self.ToggleBotton_5.setDefault(False) 1556 | 1557 | 1558 | QMetaObject.connectSlotsByName(MainWindow) 1559 | # setupUi 1560 | 1561 | def retranslateUi(self, MainWindow): 1562 | MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None)) 1563 | self.Author.setText(QCoreApplication.translate("MainWindow", u"By javier", None)) 1564 | self.Title.setText(QCoreApplication.translate("MainWindow", u"YoloSide", None)) 1565 | self.ToggleBotton.setText(QCoreApplication.translate("MainWindow", u"Hide", None)) 1566 | self.src_file_button.setText(QCoreApplication.translate("MainWindow", u"Local File", None)) 1567 | self.src_cam_button.setText(QCoreApplication.translate("MainWindow", u"Camera", None)) 1568 | self.src_rtsp_button.setText(QCoreApplication.translate("MainWindow", u"Rtsp", None)) 1569 | self.VersionLabel.setText(QCoreApplication.translate("MainWindow", u"Version: 2.0", None)) 1570 | self.explain_title.setText(QCoreApplication.translate("MainWindow", u"YoloSide App \u2013 A Graphical User Interface For YoloV8", None)) 1571 | self.settings_button.setText("") 1572 | self.min_sf.setText("") 1573 | self.max_sf.setText("") 1574 | self.close_button.setText("") 1575 | self.char_label.setText(QCoreApplication.translate("MainWindow", u"Detection", None)) 1576 | self.label_5.setText(QCoreApplication.translate("MainWindow", u"Total Classes", None)) 1577 | self.Class_num.setText("") 1578 | self.label_6.setText(QCoreApplication.translate("MainWindow", u"Total Targets", None)) 1579 | self.Target_num.setText("") 1580 | self.label_7.setText(QCoreApplication.translate("MainWindow", u"Fps", None)) 1581 | self.fps_label.setText("") 1582 | self.label_8.setText(QCoreApplication.translate("MainWindow", u"Use Model", None)) 1583 | self.Model_name.setText("") 1584 | self.pre_video.setText("") 1585 | self.res_video.setText("") 1586 | self.run_button.setText("") 1587 | self.stop_button.setText("") 1588 | self.label.setText(QCoreApplication.translate("MainWindow", u"Settings", None)) 1589 | self.ToggleBotton_6.setText(QCoreApplication.translate("MainWindow", u"Model", None)) 1590 | self.model_box.setPlaceholderText("") 1591 | self.ToggleBotton_2.setText(QCoreApplication.translate("MainWindow", u"IOU", None)) 1592 | self.ToggleBotton_3.setText(QCoreApplication.translate("MainWindow", u"Conf", None)) 1593 | self.ToggleBotton_4.setText(QCoreApplication.translate("MainWindow", u"Delay(ms)", None)) 1594 | self.ToggleBotton_5.setText(QCoreApplication.translate("MainWindow", u"Save", None)) 1595 | self.save_res_button.setText(QCoreApplication.translate("MainWindow", u"Save MP4/JPG", None)) 1596 | self.save_txt_button.setText(QCoreApplication.translate("MainWindow", u"Save Labels(.txt)", None)) 1597 | self.status_bar.setText(QCoreApplication.translate("MainWindow", u"Welcome!", None)) 1598 | # retranslateUi 1599 | 1600 | -------------------------------------------------------------------------------- /ui/rtsp_dialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Form 4 | 5 | 6 | 7 | 0 8 | 0 9 | 783 10 | 40 11 | 12 | 13 | 14 | 15 | 0 16 | 40 17 | 18 | 19 | 20 | 21 | 16777215 22 | 41 23 | 24 | 25 | 26 | Form 27 | 28 | 29 | 30 | :/img/icon/实时视频流解析.png:/img/icon/实时视频流解析.png 31 | 32 | 33 | #Form{background:rgba(120,120,120,255)} 34 | 35 | 36 | 37 | 5 38 | 39 | 40 | 5 41 | 42 | 43 | 44 | 45 | 46 | 0 47 | 30 48 | 49 | 50 | 51 | 52 | 16777215 53 | 30 54 | 55 | 56 | 57 | QLabel{font-family: "Microsoft YaHei"; 58 | font-size: 18px; 59 | font-weight: bold; 60 | color:white;} 61 | 62 | 63 | rtsp address: 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 0 72 | 31 73 | 74 | 75 | 76 | background-color: rgb(207, 207, 207); 77 | 78 | 79 | 80 | 81 | 82 | 83 | QPushButton{font-family: "Microsoft YaHei"; 84 | font-size: 18px; 85 | font-weight: bold; 86 | color:white; 87 | text-align: center center; 88 | padding-left: 5px; 89 | padding-right: 5px; 90 | padding-top: 4px; 91 | padding-bottom: 4px; 92 | border-style: solid; 93 | border-width: 0px; 94 | border-color: rgba(255, 255, 255, 255); 95 | border-radius: 3px; 96 | background-color: rgba(255,255,255,30);} 97 | 98 | QPushButton:focus{outline: none;} 99 | 100 | QPushButton::pressed{font-family: "Microsoft YaHei"; 101 | font-size: 16px; 102 | font-weight: bold; 103 | color:rgb(200,200,200); 104 | text-align: center center; 105 | padding-left: 5px; 106 | padding-right: 5px; 107 | padding-top: 4px; 108 | padding-bottom: 4px; 109 | border-style: solid; 110 | border-width: 0px; 111 | border-color: rgba(255, 255, 255, 255); 112 | border-radius: 3px; 113 | background-color: rgba(255,255,255,150);} 114 | 115 | QPushButton::hover { 116 | border-style: solid; 117 | border-width: 0px; 118 | border-radius: 0px; 119 | background-color: rgba(255,255,255,50);} 120 | 121 | 122 | confirm 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /utils/capnums.py: -------------------------------------------------------------------------------- 1 | import cv2 2 | 3 | 4 | class Camera: 5 | def __init__(self, cam_preset_num=5): 6 | self.cam_preset_num = cam_preset_num 7 | 8 | def get_cam_num(self): 9 | cnt = 0 10 | devices = [] 11 | for device in range(0, self.cam_preset_num): 12 | stream = cv2.VideoCapture(device, cv2.CAP_DSHOW) 13 | grabbed = stream.grab() 14 | stream.release() 15 | if not grabbed: 16 | continue 17 | else: 18 | cnt = cnt + 1 19 | devices.append(device) 20 | return cnt, devices 21 | 22 | 23 | if __name__ == '__main__': 24 | cam = Camera() 25 | cam_num, devices = cam.get_cam_num() 26 | print(cam_num, devices) 27 | -------------------------------------------------------------------------------- /utils/rtsp_dialog.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'rtsp_dialog.ui' 4 | # 5 | # Created by: PyQt5 UI code generator 5.15.2 6 | # 7 | # WARNING: Any manual changes made to this file will be lost when pyuic5 is 8 | # run again. Do not edit this file unless you know what you are doing. 9 | 10 | 11 | from PySide6 import QtCore, QtGui, QtWidgets 12 | 13 | 14 | class Ui_Form(object): 15 | def setupUi(self, Form): 16 | Form.setObjectName("Form") 17 | Form.resize(783, 40) 18 | Form.setMinimumSize(QtCore.QSize(0, 40)) 19 | Form.setMaximumSize(QtCore.QSize(16777215, 41)) 20 | icon = QtGui.QIcon() 21 | icon.addPixmap(QtGui.QPixmap(":/img/None.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) 22 | Form.setWindowIcon(icon) 23 | Form.setStyleSheet("#Form{background:rgba(120,120,120,255)}") 24 | self.horizontalLayout = QtWidgets.QHBoxLayout(Form) 25 | self.horizontalLayout.setContentsMargins(-1, 5, -1, 5) 26 | self.horizontalLayout.setObjectName("horizontalLayout") 27 | self.label = QtWidgets.QLabel(Form) 28 | self.label.setMinimumSize(QtCore.QSize(0, 30)) 29 | self.label.setMaximumSize(QtCore.QSize(16777215, 30)) 30 | self.label.setStyleSheet("QLabel{font-family: \"Microsoft YaHei\";\n" 31 | "font-size: 18px;\n" 32 | "font-weight: bold;\n" 33 | "color:white;}") 34 | self.label.setObjectName("label") 35 | self.horizontalLayout.addWidget(self.label) 36 | self.rtspEdit = QtWidgets.QLineEdit(Form) 37 | self.rtspEdit.setMinimumSize(QtCore.QSize(0, 31)) 38 | self.rtspEdit.setStyleSheet("background-color: rgb(207, 207, 207);") 39 | self.rtspEdit.setObjectName("rtspEdit") 40 | self.horizontalLayout.addWidget(self.rtspEdit) 41 | self.rtspButton = QtWidgets.QPushButton(Form) 42 | self.rtspButton.setStyleSheet("QPushButton{font-family: \"Microsoft YaHei\";\n" 43 | "font-size: 18px;\n" 44 | "font-weight: bold;\n" 45 | "color:white;\n" 46 | "text-align: center center;\n" 47 | "padding-left: 5px;\n" 48 | "padding-right: 5px;\n" 49 | "padding-top: 4px;\n" 50 | "padding-bottom: 4px;\n" 51 | "border-style: solid;\n" 52 | "border-width: 0px;\n" 53 | "border-color: rgba(255, 255, 255, 255);\n" 54 | "border-radius: 3px;\n" 55 | "background-color: rgba(255,255,255,30);}\n" 56 | "\n" 57 | "QPushButton:focus{outline: none;}\n" 58 | "\n" 59 | "QPushButton::pressed{font-family: \"Microsoft YaHei\";\n" 60 | " font-size: 16px;\n" 61 | " font-weight: bold;\n" 62 | " color:rgb(200,200,200);\n" 63 | " text-align: center center;\n" 64 | " padding-left: 5px;\n" 65 | " padding-right: 5px;\n" 66 | " padding-top: 4px;\n" 67 | " padding-bottom: 4px;\n" 68 | " border-style: solid;\n" 69 | " border-width: 0px;\n" 70 | " border-color: rgba(255, 255, 255, 255);\n" 71 | " border-radius: 3px;\n" 72 | " background-color: rgba(255,255,255,150);}\n" 73 | "\n" 74 | "QPushButton::hover {\n" 75 | "border-style: solid;\n" 76 | "border-width: 0px;\n" 77 | "border-radius: 0px;\n" 78 | "background-color: rgba(255,255,255,50);}") 79 | self.rtspButton.setObjectName("rtspButton") 80 | self.horizontalLayout.addWidget(self.rtspButton) 81 | 82 | self.retranslateUi(Form) 83 | QtCore.QMetaObject.connectSlotsByName(Form) 84 | 85 | def retranslateUi(self, Form): 86 | _translate = QtCore.QCoreApplication.translate 87 | Form.setWindowTitle(_translate("Form", "Form")) 88 | self.label.setText(_translate("Form", "rtsp address:")) 89 | self.rtspButton.setText(_translate("Form", "confirm")) 90 | # import apprcc_rc 91 | -------------------------------------------------------------------------------- /utils/rtsp_win.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from PySide6.QtWidgets import QApplication, QWidget 3 | from utils.rtsp_dialog import Ui_Form 4 | 5 | 6 | class Window(QWidget, Ui_Form): 7 | def __init__(self): 8 | super(Window, self).__init__() 9 | self.setupUi(self) 10 | 11 | 12 | if __name__ == '__main__': 13 | app = QApplication(sys.argv) 14 | window = Window() 15 | window.show() 16 | sys.exit(app.exec()) 17 | --------------------------------------------------------------------------------