Close the current session and free GPU resources. Call this when you're done with the current video and want to process a new one, or when you want to free up memory.
(self)
| 5315 | plt.show() |
| 5316 | |
| 5317 | def close(self) -> None: |
| 5318 | """Close the current session and free GPU resources. |
| 5319 | |
| 5320 | Call this when you're done with the current video and want to |
| 5321 | process a new one, or when you want to free up memory. |
| 5322 | """ |
| 5323 | if self.session_id is not None: |
| 5324 | self.predictor.handle_request( |
| 5325 | request=dict( |
| 5326 | type="close_session", |
| 5327 | session_id=self.session_id, |
| 5328 | ) |
| 5329 | ) |
| 5330 | self.session_id = None |
| 5331 | print("Session closed.") |
| 5332 | |
| 5333 | def shutdown(self) -> None: |
| 5334 | """Shutdown the predictor and free all GPU resources. |
no outgoing calls
no test coverage detected